A common pattern for configuration loading is to use class inheritance
to define common settings with production and development overrides,
DEBUG = False
TESTING = False
SECRET_KEY = 'secret'
DEBUG = True
SECRET_KEY = 'an actually secret key'
This can then be loaded in say a create_app function, for example:
"""In production create as app = create_app('Production')"""
app = Quart(__name__)
The config_class can be set to a custom class,
however it must be changed before the app is initialised as the
make_config() is called on construction.
An instance folder is a deployment specific location to store files
and configuration settings. As opposed to loading files relative to
the app root path open_resource() you can load
files relative to an instance path
open_instance_resource() including the
configuration. To load the configuration from this folder, instead of
relative to the app root path simply provide the
instance_relative_config argument as True when initialising
the app app = Quart(__name__, instance_relative_config=True).
app = Quart(__name__, instance_relative_config=True)
The instance path can be specified when initialising the app, or found
automatically if it exists. The search locations are:
or if the app has been installed: