UID is the User ID. GID is the Group ID. These are unique identifiers in two databases: one of users and one of groups.
For example, my uid is 716. I'm in the faculty
group, which is gid 501.
Our version of Linux creates a group for each user, so most of you are in a group of one. But the sysadmin can modify your group if desired.
It allows you do commands restricted to the "super user" (AKA Administrator AKA root).
(Actually, it just means "switch user" but 99.99% of the time it's used to switch to root.)
You are admin on your own laptop, but not on Tempest (the CS server).
Yep, that's very common. We'll go back to our organizing picture and review.
Apache is a web server. (There are others, like Nginx, IIS, etc.) That means it listens to the network for web requests (HTTP and HTTPS) and responds to them.
Flask allows us to set up a web server for developing our app. It also listens for web requests and responds. Usually, it's our code that runs to actually do the response. But Flask takes care of a lot of necessary stuff: parsing the request, routing it to the correct function, etc.
Tempest is a computer that Apache and Flask are running on.
When Flask runs, it has to open a port: a numbered door to listen for requests. We all have to use different ports.
A request is when a browser asks a server for a web page. There are two kinds: GET and POST, like we talked about last time. Most requests are GET requests for a simple URL.
"Handling a request" means providing a web page in answer to the request.
When our Flask (Python) code runs, it has the option of connecting to the database and getting data from it.
Takes care of a lot of the necessary but routine infrastructure for creating a web application. Every web application has to parse the request, route it to the appropriate handler, package up the result (adding HTTP headers and such). Why not centralize that in a shared library?
We will!
Sure! Let's look at the routing section.
I think what you're confused about is the magic decorator syntax. I'll do a brief aside on that, but most students end up treating it as, well, magic syntax.
Conceptually, Flask sets up a dictionary mapping endpoints (parts
of a URL) to functions (to handle that endpoint).
The @route
decorator pairs an endpoint with a function.
Yep.
Typically, the venv is a subdirectory of the project directory, but there are lots of variations on that theme.
It doesn't really matter. The python modules will be loaded from the venv and from the local files, which don't have to be co-located.
We'll set one up today. By saying a "virtualenv is independent" it means that modules in one venv don't have to have anything to do with the modules in another. One can have Flask 1.1.1 and another can have Flask 2.3.3. They can even be for different versions of Python, say 3.6 versus 3.9. (In fact, I have just that situation.)