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 preferences
with preferences() as prefs:
# And that's how we expose our options to Admin.
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-1.1.0.tar.gz
(22.1 kB
view details)
Built Distribution
File details
Details for the file django-siteprefs-1.1.0.tar.gz
.
File metadata
- Download URL: django-siteprefs-1.1.0.tar.gz
- Upload date:
- Size: 22.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/2.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9fc94ff2293c47383be2ca2a4a6ea078b0caed5203ba0d9b47801a92e2f581d |
|
MD5 | 51828a44977cb1f1535c6d658841dc6f |
|
BLAKE2b-256 | 7e7a18817a2c57adecb5aea4a3830c072ecd3dea02d4a2e4f86fca18a563f405 |
Provenance
File details
Details for the file django_siteprefs-1.1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: django_siteprefs-1.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 21.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/2.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6684ec015d8884615ebc787cc872c4dfb275f11e917145be282ccb93706d19c3 |
|
MD5 | cacdb9e25b32a50f04175e1d0b3a1711 |
|
BLAKE2b-256 | 99bf39f2cc6558abb2adaf5422c590755b543040ee6ed1ac5df4d7a575114cd7 |