You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of getting config manually from the settings module like:
app=Flask(__name__)
app.name=settings.APP_NAMEapp.config["SQLALCHEMY_DATABASE_URI"] =settings.SQLALCHEMY_DATABASE_URI# etc.
Flask has built-in support for loading the configuration from a number of sources. We're using the Python files format, which would look something like:
Instead of getting config manually from the
settings
module like:Flask has built-in support for loading the configuration from a number of sources. We're using the Python files format, which would look something like:
We can also load from a number of supported file types:
Or directly from certain environment variables:
Let's use the built-in framework for loading configuration data.
See also: Flask Configuration Best Practices
The text was updated successfully, but these errors were encountered: