The Flask Mega-Tutorial, Part I: Hello, World!
flaskpythonweb-developmenttutorialvirtual-environments
Abstraction: Flask web application setup tutorial covering installation and Hello World app
Key points:
- Recommends using Python virtual environments (
python3 -m venv venv) to isolate package versions per project, avoiding global installation conflicts - Flask 3.x used in the 2024 edition; install via
pip install flaskinside activated venv - Application structured as a Python package (
app/) with__init__.pycreating the Flask instance and aroutes.pymodule defining view functions - Routes mapped via
@app.routedecorators;flask runstarts dev server on port 5000 by default FLASK_APPenvironment variable tells Flask which module to import;python-dotenv+.flaskenvfile automates this across sessions- 23-chapter series covering templates, forms, database, auth, deployment (Linux/Heroku/Docker), APIs, and more
Connections: Flask · Miguel Grinberg · Web Development · Python · Virtual Environments
Source: http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world