In this Flask app we will demonstrate the basics of processing forms and also using a form library called WT Forms.
To Run this application, ensure you have installed Python 3 and follow these steps:
- Clone this repository to your development environment.
- Change to the directory (e.g.
cd flask-forms
) - Create a virtual environment using
python -m venv venv
. In some cases you may need to usepython3 -m venv venv
. - Activate the virtual environment using
source venv/bin/activate
or on Windows use.\venv\Scripts\activate
. - Run
pip install -r requirements.txt
- Once that is finished, start the built-in development server using
flask --debug run
. - Next, open your web browser and go to http://127.0.0.1:5000/ , you should see the Flask forms webpage displayed.
Note: If you added a .env
file and changed the FLASK_RUN_PORT
value then you will need to change the port in the URL in step 7.