Dynamic-preferences is available on PyPI and can be installed with:

pip install django-dynamic-preferences


Add this to your settings.INSTALLED_APPS:

    # ...
    # comment the following line if you don't want to use user preferences

Then, create missing tables in your database:

python migrate dynamic_preferences

Add this to settings.TEMPLATE_CONTEXT_PROCESSORS if you want to access preferences from templates:



Also, take some time to look at provided settings if you want to customize the package behaviour:

# available settings with their default values

    # a python attribute that will be added to model instances with preferences
    # override this if the default collide with one of your models attributes/fields
    'MANAGER_ATTRIBUTE': 'preferences',

    # The python module in which registered preferences will be searched within each app
    'REGISTRY_MODULE': 'dynamic_preferences_registry',

    # Allow quick editing of preferences directly in admin list view
    # WARNING: enabling this feature can cause data corruption if multiple users
    # use the same list view at the same time, see

    # Customize how you can access preferences from managers. The default is to
    # separate sections and keys with two underscores. This is probably not a settings you'll
    # want to change, but it's here just in case

    # Use this to disable caching of preference. This can be useful to debug things
    'ENABLE_CACHE': True,

    # Use this to disable checking preferences names. This can be useful to debug things