Settings

The settings module provides a way to specify application-wide settings in a centralized registry.

Configuration

To configure settings, use app/settings.py. There will already be some defaults configured but you may add your own:

settings['cats'] = {
    'herdable': False
}

To read your settings, import ferris.settings and use get():

from ferris3 import settings

HERDABLE = settings.get('cats').get('herdable')

Warning

Although you can, it’s generraly not recommened to import app.settings directly. Using settings ensures that everything is loaded in the right order.

Functions

ferris3.settings.get(key, default=<object object at 0x10b770530>)[source]

Returns the setting at key, if available, raises an ConfigurationError if default is none, otherwise returns the default

ferris3.settings.all()[source]

Returns the entire settings registry