Previous topic

testing module

Next topic

manage module

This Page

settings module

Global settings for project.

Note some Kit-specific settings.

  • BLUEPRINTS is a list of registered blueprints.
  • CONTEXT_PROCESSORS is a list of registered context processors.
  • EXTENSIONS is a list of registered extensions.

Flask Kit will automatically register blueprints specified in the BLUEPRINTS list for you. Behaviour for CONTEXT_PROCESSORS and EXTENSIONS lists is the same.

The notation is package.module.object or package.object if object is in the __init__.py. Look into the file for examples.

copyright:(c) 2012 by Roman Semirook.
license:BSD, see LICENSE for more details.
class settings.BaseConfig[source]

Bases: object

see also: flask.Flask.default_config

BLUEPRINTS = ['base.base', 'info.info']

a list of registered blueprints.

CONTEXT_PROCESSORS = ['base.context_processors.common_context', 'base.context_processors.navigation', 'base.context_processors.common_forms']

a list of registered context processors

CSRF_ENABLED = True
DEBUG = False
EXTENSIONS = ['ext.db', 'ext.assets', 'ext.login_manager', 'ext.gravatar', 'ext.toolbar']

a list of registered extensions.

ROOT_PATH = '/home/mich/Learn/webauth/flask/flask-kit'
SECRET_KEY = 'MY_VERY_SECRET_KEY'
SQLALCHEMY_DATABASE_URI = 'sqlite:////tmp/test.db'
class settings.DevelopmentConfig[source]

Bases: settings.BaseConfig

During development, we want to enable debugging and profiling.

DEBUG = True
DEBUG_TB_INTERCEPT_REDIRECTS = False
DEBUG_TB_PROFILER_ENABLED = True
class settings.TestingConfig[source]

Bases: settings.BaseConfig

Designed for running tests, it uses an in-memory sqlite database.

>>> app = AppFactory(TestingConfig).get_app("my-tests")
SQLALCHEMY_DATABASE_URI = 'sqlite:///:memory:'
TESTING = True