Dynamic global and instance settings for your Django project. Version 1.17.0. Release cadence: infrequent, last updated in 2023.
pip install django-dynamic-preferencesNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Basic setup with global and per-user preferences. Requires Django User model to inherit from DynamicPreferencesMixin.
Ensure your User model inherits from DynamicPreferencesMixin.
from dynamic_preferences.users.mixins import DynamicPreferencesMixin
class User(DynamicPreferencesMixin, AbstractUser):
passAlways use double underscore between section and name when accessing preferences (e.g., get('general__site_name')).Migrate to class-based preference definitions.
from dynamic_preferences.preferences import GlobalPreferenceModel
from dynamic_preferences.registries import global_preferences_registry
@global_preferences_registry.register
class SiteName(GlobalPreferenceModel):
section = 'general'
name = 'site_name'
verbose_name = 'Site Name'
default = 'My Site'Use the provided template tags or manually reference the prefixed field names.
Upgrade to Python 3.6+.