A Flask application is a Flask instance that is also the WSGI app
Answer: You build a Flask app by creating an instance of the Flask class. That instance is the WSGI application. The first argument is the name of the application's module or package, and __name__ is the usual value.
Creating the instance
The name tells Flask where to look for templates and static files. To run the application, use the flask command or python -m flask, and pass --app so Flask can find the app. If the file is named app.py or wsgi.py, --app can be omitted. This launches a very simple builtin server, good enough for testing but not what you want in production.
The class in source
The Flask object is implemented as a central WSGI application. Once created, it is the registry for view functions, URL rules, and template configuration.
See also
Claims
- id: C1 claim: A Flask instance is the WSGI application. source: S1 evidence: "An instance of this class will be our WSGI application."
- id: C2 claim: The first argument is the application's module or package name. source: S1 evidence: "The first argument is the name of the application's module or package."
- id: C3 claim: The Flask object implements a WSGI application and is the central object. source: S2 evidence: "The flask object implements a WSGI application and acts as the central"
- id: C4 claim: After creation, the object is a registry for views, URL rules, and templates. source: S2 evidence: "it will act as a central registry for"
Sources
- [S1] Quickstart. Flask docs. https://flask.palletsprojects.com/en/stable/quickstart/ . License: BSD-3-Clause. Accessed 2026-11-11.
- [S2] Flask class (sansio App). Flask source. https://github.com/pallets/flask/blob/main/src/flask/sansio/app.py . License: BSD-3-Clause. Accessed 2026-11-11.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources and notices: Flask documentation and source (pallets/flask): Copyright 2010 Pallets; BSD-3-Clause (https://raw.githubusercontent.com/pallets/flask/main/LICENSE.txt). Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Flask docs and Flask source (pallets/flask), BSD-3-Clause (https://raw.githubusercontent.com/pallets/flask/main/LICENSE.txt). Notices: Flask documentation and source (pallets/flask): Copyright 2010 Pallets; BSD-3-Clause (https://raw.githubusercontent.com/pallets/flask/main/LICENSE.txt).
Cite this
iinventedlight. 2026. "A Flask application is a Flask instance that is also the WSGI app." iinventedlight Library, iil:note:v4cb506p, version of 2026-11-11. https://iinventedlight.com/library/notes/flask-application/. License: CC-BY-4.0.
@misc{iil_note_v4cb506p,
author = {{iinventedlight}},
title = {{A Flask application is a Flask instance that is also the WSGI app}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-11},
url = {https://iinventedlight.com/library/notes/flask-application/},
note = {Permanent ID iil:note:v4cb506p. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/flask-application.md.