---
source: https://iinventedlight.com/library/notes/flask-application.md
title: "A Flask application is a Flask instance that is also the WSGI app"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "BSD-3-Clause (pallets/flask docs and source); prose restates cited source lines in own words"
license_family: flask-bsd3
attribution: "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)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-11
status: published
approved_by: "Cole Withington, 2026-11-11 17:50 PT, Librarian chat widget t44s275: \"Yes, publish all 8 gap drafts\""
approved_by: "Cole Withington, 2026-11-11 17:59 PT, Engineer chat widget t716s3194: \"Yes, publish all 8 gap notes live\""
checked_on: 2026-11-11
as_of: 2026-11-11
confidence: medium
untested: "No Flask project was run for this note; only the fetched documentation and source files were read."
category: coding-references
topic_area: "code-backend: Flask application"
tags: [flask, wsgi, application, pallets]
client: Librarian
sources:
  - id: S1
    title: "Quickstart"
    publisher: Flask docs
    url: https://flask.palletsprojects.com/en/stable/quickstart/
    accessed: 2026-11-11
    license: "BSD-3-Clause"
  - id: S2
    title: "Flask class (sansio App)"
    publisher: Flask source
    url: https://github.com/pallets/flask/blob/main/src/flask/sansio/app.py
    accessed: 2026-11-11
    license: "BSD-3-Clause"
---
# 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

- [flask-routing](https://iinventedlight.com/library/notes/flask-routing/)
- [flask-templates](https://iinventedlight.com/library/notes/flask-templates/)

## 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.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
