Settings
Misago settings belong to one of two groups:
Dynamic settings
Those settings are stored in database and can be changed at the runtime using interface provided by admin control panel.
Accessing dynamic settings in python code
Dynamic settings can be accessed through the settings
attribute on request
:
This method is available only during http request life-cycle. If you need to access dynamic settings outside of it (eg. in management command), you will have to instantiate misago.conf.dynamicsettings.DynamicSettings
manually:
Accessing dynamic settings in template
Dynamic settings object is made available to the templates as settings
variable:
Lazy settings
Not all dynamic settings settings are available at all times. Some settings (called lazy settings), are only available as True
or None
when accessed. To obtain their "real" value you need to call the get_lazy_setting_value
method on settings object:
Static settings
Those settings must be available when Misago starts and are not changeable at the runtime (e.g. from admin control panel), hence the name "static".
To define or change those settings, you need to edit your site's settings.py
Accessing static settings in python code
Static settings are available as attributes on settings
object importable from misago.conf.settings
:
misago.conf.settings
first attempts to read setting value in your site's settings.py
, and when its not defined here, uses default value defined inside Misago source code.
misago.conf.settings
is fully compatible with django.conf.settings
. If your code is not accessing MISAGO_*
settings, you can use either of those approaches for accessing static configuration. misago.conf.settings
is only recommended when you are using MISAGO_*
settings in your code.
Django Settings Reference
Django defines plenty of configuration options that control behaviour of different features that Misago relies on.
Those are documented and available in Django documentation.
Last updated