Running the Flask Project
00:00 Now that you have created a simple Flask application, let’s run it. Open your terminal within the project’s root directory, and make sure you activate the virtual environment if it’s not already activated.
00:13
Now enter the command python -m flask run
. This command starts the Flask development server, and prints a message in the terminal telling you the address where your app is running.
00:26 Open this address in your web browser and you should see the Hello, World! message being displayed.
00:32 This confirms that our basic Flask application is working correctly.

Bartosz Zaczyński RP Team on Sept. 19, 2025
@Aurelio Hernández López That’s a fair point, Aurelio. Thanks for flagging it!
As to your question, you can find the answer in Flask’s command-line help:
An application to load must be given with the ‘–app’ option, ‘FLASK_APP’ environment variable, or with a ‘wsgi.py’ or ‘app.py’ file in the current directory.
By default, Flask’s development server looks for your application code in the app.py
module when you don’t specify any of the other options. You can be more explicit if you want to indicate a different file, such as main.py
, using one of these commands:
$ python -m flask --app main run
$ FLASK_APP=main python -m flask run
On Windows, setting environment variables might look a bit different, though.
Become a Member to join the conversation.
Aurelio Hernández López on Sept. 18, 2025
It would be good to mention that the name of the Python file has been changed from
main.py
(in the last video) toapp.py
(in the current video). The commandpython -m flask run
does not work withmain.py
but it does withapp.py
. Could you further explain?