Stay informed of it
Project description
Django Dynamic Settings
Django Dynamic Settings allows you to create & use dynamic settings backed by a database.
Installation
Installation using pip:
pip install dj-dynamic-settings
dj_dynamic_settings
app has to be added to INSTALLED_APPS
and migrate
command has to be run.
INSTALLED_APPS = (
# other apps here...
"dj_dynamic_settings",
)
dj_dynamic_settings.urls
must be included to a desired url path.
urlpatterns = [
...,
url(r"^api/v1/", include("dj_dynamic_settings.urls")),
]
Setting class must be defined & registered. Please make sure that this class' module runs whenever the application runs.
from dj_dynamic_settings.registry import BaseSetting, registry
from dj_dynamic_settings.validators import TypeValidator
@registry.register
class FeatureActive(BaseSetting):
key = "FEATURE_ACTIVE"
validators = [TypeValidator(bool)]
default = False
description = "Flag for Feature X"
Create Setting
instance using view.
import requests
requests.post(
url="https://your-app.com/api/v1/dynamic_settings/",
headers={
"Authorization": "Token <secret-login-token>",
},
json={
"key": "FEATURE_ACTIVE",
"value": True,
"is_active": True,
}
)
Access this setting as in django.conf.settings
from dj_dynamic_settings.conf import settings
settings.FEATURE_ACTIVE # True
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dj-dynamic-settings-0.1.0.tar.gz
(11.4 kB
view hashes)
Built Distribution
Close
Hashes for dj-dynamic-settings-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61061ab29963fc30f3b93ea80496e029604cb20a1b7736e088a1eaa5f9e605e6 |
|
MD5 | 81831b89747b4bc5dc94d10cdf619a55 |
|
BLAKE2b-256 | 7abc24096bb3bd756a8a541e04f4a33576c3e7f811bb0414f210d2e626aae3ae |
Close
Hashes for dj_dynamic_settings-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75e01300fcca161e635e08cca0a7a70e366e7fce21ca6150d5e9c08cff9f76cb |
|
MD5 | 7081a422f941a66119c798784ad1fa4b |
|
BLAKE2b-256 | 26e8e769f6bac6a124d5c81981e59a5c550c74bde1cbae54f86eca08dd8b7765 |