Skip to main content

Reusable app for Django introducing site preferences system

Project description

http://github.com/idlesign/django-siteprefs

https://img.shields.io/pypi/v/django-siteprefs.svg https://img.shields.io/pypi/l/django-siteprefs.svg https://img.shields.io/coveralls/idlesign/django-siteprefs/master.svg

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

http://django-siteprefs.readthedocs.org/

Project details


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.2.3.tar.gz (22.6 kB view details)

Uploaded Source

Built Distribution

django_siteprefs-1.2.3-py2.py3-none-any.whl (22.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-siteprefs-1.2.3.tar.gz.

File metadata

  • Download URL: django-siteprefs-1.2.3.tar.gz
  • Upload date:
  • Size: 22.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/2.7

File hashes

Hashes for django-siteprefs-1.2.3.tar.gz
Algorithm Hash digest
SHA256 65ae6a1403ae75e33e6c4d63ebe0974f511346a1cf2be10efff7ed56b6a0e13e
MD5 ea9d9552942c3d2a00fbf64532fa5f7d
BLAKE2b-256 ea9255b9d9d809d340ff8f164005d24b78baaa6b3342074ad4149e5b11a30e0c

See more details on using hashes here.

File details

Details for the file django_siteprefs-1.2.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_siteprefs-1.2.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2c83c9216c2b341dd526d80489e1049da2960c38af2d61758b5c567298eb1137
MD5 3c9ef43c485861dba648b501992b92de
BLAKE2b-256 28d509a323b01c8fcff7f1d068d5bc2b349d510276110276b67259fc3143b6e4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page