helpers module
Implements useful helpers.
There is the application factory and, maybe,
something else (in the future) to avoid routine.
copyright: | (c) 2012 by Roman Semirook. |
license: | BSD, see LICENSE for more details. |
-
class helpers.AppFactory(config, envvar='PROJECT_SETTINGS', bind_db_object=True)[source]
Bases: object
Flask application factory.
>>> app = AppFactory(TestingConfig).get_app(__name__)
-
__init__(config, envvar='PROJECT_SETTINGS', bind_db_object=True)[source]
Defines default application settings
Parameters: |
- config – an object to load initial configuration from
- envvar – The name of an environment variable to update configuration from
- bind_db_object –
|
-
get_app(app_module_name, **kwargs)[source]
Actually instanciates a Flask application with active settings,
and taking care of registering extensions and blueprints
Parameters: |
- app_module_name – the name of the application package, see Flask
- kwargs – keyword arguments passed to the Flask constructor
|
Returns: | A new WSGI application object
|
-
exception helpers.NoBlueprintException[source]
Bases: exceptions.Exception
-
exception helpers.NoContextProcessorException[source]
Bases: exceptions.Exception
-
exception helpers.NoExtensionException[source]
Bases: exceptions.Exception