Hello Flask on your Local Machine

If you’re running your Flask app on your local machine, using IDLE, PyCharm, a Raspberry Pi, or a text editor,  you need to install flask.  Depending on how you installed python, you’ll either type:

pip install flask

OR

pip3 install flask

if you’re not sure which, try both.   If neither work, and you’re on Windows, try installing Python again and make sure you click the “Add Python to PATH” checkbox.

Then in your Flask application,  you need to add a few lines of code at the bottom of your application.py file.

The minimum file should look like this:

 

You can run the app as normal, either using the run menu item or at the command line with

python application.py

 

Good Luck!  If you’re stuck, get in touch and I’ll try to help.