Skip to content

Commit

Permalink
Add app factory term
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Jan 26, 2023
1 parent 4ee6f09 commit fa794eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Now you only have to write two functions:

- `setup_logging()` that takes a configuration and configures {mod}`logging`.
- `make_app()` that creates a WSGI application based on your configuration.
For Flask, you would instantiate `flask.Flask`, load your [blueprints](https://flask.palletsprojects.com/en/latest/blueprints/), et cetera here.
Flask calls this an [*Application Factory*](https://flask.palletsprojects.com/en/latest/patterns/appfactories/) and you would instantiate `flask.Flask`, load your [blueprints](https://flask.palletsprojects.com/en/latest/blueprints/), et cetera here.

As you can see: you can now test both `setup_logging` as well as `make_app` without loading the configuration from your environment every single time.

Expand Down

0 comments on commit fa794eb

Please sign in to comment.