This is a very basic Flask application using two routes and an interactive form. It illustrates how to use Flask-WTF and Flask-Bootstrap in a Flask app.
The code is explained in this slide deck.
A first version of the app is in actors.py. To run it, it is assumed that you:
-
Are using Python 3.x.
-
Have already installed Flask and its dependencies.
-
Have activated your virtualenv (if you are using one).
Run the app by entering its folder in Terminal and typing:
$ python actors.py
Then open your web browser and type this in the address bar:
localhost:5000/
A second version of the app is in actors_2.py.
Run the app by entering its folder in Terminal and typing:
$ python actors_2.py
Then open your web browser and type this in the address bar:
localhost:5000/
Note that if the Flask web server was already running before this, you'll need to stop it by pressing Control-C in Terminal before you run actors_2.py.
For a similar Flask app that does not use Flask-WTF or Flask-Bootstrap, see: Flask Example
For a complete basic Flask example with more templates, see: Basic Flask App