App

class keg.app.Keg(import_name=None, *args, **kwargs)[source]
cli_loader_class

alias of keg.cli.CLILoader

config_class

alias of keg.config.Config

logger

Standard logger for the app.

make_config(instance_relative=False)[source]

Needed for Flask <= 0.10.x so we can set the configuration class being used. Once 0.11 comes out, Flask supports setting the config_class on the app.

on_config_complete()[source]

For subclasses to override

on_init_complete()[source]

For subclasses to override

request_context(environ)[source]

Request context for the app.

route(rule, **options)[source]

Enable .route() to be used in a class context as well. E.g.:

KegApp.route('/something'):
def view_something():
    pass
classmethod testing_prep(**config)[source]
  1. Instantiate the app class.
  2. Cache the app instance after creation so that it’s only instantiated once per Python
    process.
  3. Trigger signal.testing_run_start the first time this method is called for an app
    class.