Skip to content

Flask: Use app.extension instead of app.config  #72

Description

@hynek

This is a minor nit, but I find that app.config is usually filled with things which might be set from an external config.py file, environment variable, or some other source. I often even like to be able to render these things back to e.g. JSON to save the current configuration for debugging.

OTOH, flask provides app.extensions as a specific place for extensions to store state, and many flask extensions do that (e.g. Flask-SQLAlchemy).

What do you think about having svcs store the Registry object (which is managed by svcs, and wouldn't make much sense to set as the end user) in app.extensions?

Originally posted by @alexrudy in #71

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions