sqlite3 with flask web application CRUD pdf 1

sqlite3 with flask web application CRUD pdf

$ export FLASK_CONFIG=development
$ export FLASK_APP=run.py
$ flask run
 * Serving Flask app "run"
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)

Here is what the above code is Doing:
1. We import the Flask class. An instance of this class will be our WSGI application.
2. We create the Flask instance, passing __name__ as argument to the constructor.
3. We then use the route() decorator to tell Flask what URL should trigger our function.
4. The function is given a name which is also used to generate URLs for that particular function, and returns the message we want to display in the user’s browser.
5. Finally we use the run() function to run the local server with our application.

Similar Posts