Jump to >


class SiteConfigSettingsWrapper(siteconfig)[source]

Bases: object

Wraps the settings for a SiteConfiguration.

This is used by the context processor for templates to wrap accessing settings data, properly returning defaults.

class SiteConfiguration(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Configuration data for a site. The version and all persistent settings are stored here.

The usual way to retrieve a SiteConfiguration is to use get_current().

__init__(*args, **kwargs)[source]
get(key, default=None)[source]

Retrieves a setting. If the setting is not found, the default value will be returned. This is represented by the default parameter, if passed in, or a global default if set.

set(key, value)[source]

Sets a setting. The key should be a string, but the value can be any native Python object.


Add a dictionary of defaults.

These defaults will be used when calling get(), if that setting wasn’t saved in the database.

add_default(key, default_value)[source]

Adds a single default setting.


Returns all default settings registered with this SiteConfiguration.


Returns whether or not this SiteConfiguration is expired and needs to be reloaded.

save(clear_caches=True, **kwargs)[source]
set_settings_json(model_instance, json)[source]