Skip to content

Repository files navigation

django-knobs

PyPI - Python VersionPyPIChecks

Library for dynamic settings / feature flags that can be changed at runtime without restarting the application from Django admin panel.

pip install django-knobs

Setup

1. Add to INSTALLED_APPS:

INSTALLED_APPS= [
...
"knobs",
]

2. Run migrations:

python manage.py migrate

3. Define your config values in settings.py:

fromknobsimportKnobKNOBS_CONFIG= {
"MAX_LOGIN_ATTEMPTS": Knob(default=5, help_text="Max failed logins before lockout", category="auth"),
"FEATURE_NEW_UI": Knob(default=False, help_text="Enable redesigned UI", category="features"),
"API_TIMEOUT": Knob(default=30.0, help_text="Outbound request timeout (seconds)", category="api"),
"WELCOME_MSG": Knob(default="Hello!", help_text="Welcome banner text", category="general"),
}

About

Django library for dynamic settings

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages