← All notes

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

Sources

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

Permanent ID: iil:note:v4cb506p

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.},
}

Markdown

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.