Reusable app for Django introducing site preferences system
Project description
http://github.com/idlesign/django-siteprefs
What’s that
django-siteprefs allows Django applications settings to come alive
Let’s suppose you have your pretty settings.py file with you application:
from django.conf import settings
MY_OPTION_1 = getattr(settings, 'MY_APP_MY_OPTION_1', True)
MY_OPTION_2 = getattr(settings, 'MY_APP_MY_OPTION_2', 'Some value')
MY_OPTION_42 = getattr(settings, 'MY_APP_MY_OPTION_42', 42)
Now you want these options to be exposed to Django Admin interface. Just add the following:
# To be sure our app is still functional without django-siteprefs.
if 'siteprefs' in settings.INSTALLED_APPS:
from siteprefs.toolbox import patch_locals, register_prefs
patch_locals() # This bootstrap is required before `register_prefs` step.
# And that's how we expose our options to Admin.
register_prefs(MY_OPTION_1, MY_OPTION_2, MY_OPTION_42)
After that you can view your settings in Django Admin.
If you want those settings to be editable through the Admin - siteprefs allows that too, and even more.
Read the docs ;)
Documentation
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
django-siteprefs-0.7.0.tar.gz
(19.4 kB
view hashes)
Built Distribution
Close
Hashes for django_siteprefs-0.7.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d80d6b87830e91a778bc3eecdce238c5a9b8ad6d0941e566183cb7d6f57f4423 |
|
MD5 | 15fd250c8ce9ccedfd9bb53841d5d66c |
|
BLAKE2b-256 | 3dbf7f3e473c61db76cf2a3549cfa947dfa01c534ff4b583a40b2a99f329e2c7 |