Package: django-new-preferences
Django PreferencesDjango app allowing users to set app specific preferences through the admin interface.Provides singleton admin views for Preferences objects and a simple interface to preference values.
Singleton views ensure only one preference intance per site is available for eachPreferencesclass.Notedjango-new-preferences requires and supportsDjango’s “sites” framework, which means you can have multiple preferences, each associated with a particular site.Notedjango-new-preferences version 0.0.5 and higher requires Django 1.3 and higher for correct operation. If you are getting the super vagueError: cannot import name receivererror on startup either update to Django 1.3 or use django-new-preferences version 0.0.4 or earlier.ContentsDjango PreferencesInstallationUsageAuthorsChangelognext0.20.10.0.60.0.5 (2011-08-17)0.0.4 (2011-08-11)0.0.30.0.20.0.1InstallationInstall or adddjango-new-preferencesto your Python path.Addpreferencesto yourINSTALLED APPSsetting.Adddjango.contrib.sitesto yourINSTALLED APPSsetting. django-new-preferences associates preferences to specific sites and thus requires Django’s “sites” framework to be installed.Optionally, addpreferences.context_processors.preferences_cpto your template context processors settings. This will automatically add apreferencesvariable to your template context:TEMPLATE_CONTEXT_PROCESSORS = (
    ...other context processors...,
    "preferences.context_processors.preferences_cp",
)UsageTo create preferences for your app create a Django ORM model as usual, with the model inheriting frompreferences.models.Preferences. Also specifypreferences.modelsas your model’s module:from django.db import models
from preferences.models import Preferences

class MyPreferences(Preferences):
    portal_contact_email = models.EmailField()Admin classes are specified as per usual, except that they have to inherit from or be registered withpreferences.admin.PreferencesAdmin, i.e.:from django.contrib import admin

from preferences.admin import PreferencesAdmin
from <my_app>.models import MyPreferences

admin.site.register(MyPreferences, PreferencesAdmin)When your model is registered with admin it will show up under thePreferencesapp label in Django admin.Preferences can be accessed in Python by importing thepreferencesmodule and traversing to your required preference in the formpreferences.<ModelName>.<field>, i.e.:from preferences import preferences

portal_contact_email = preferences.MyPreferences.portal_contact_emailIf you’ve specified thepreferences.context_processors.preferences_cpas aTEMPLATE_CONTEXT_PROCESSORSyou can similarly access your preferences within templates through thepreferencesvariable, i.e.:{{ preferences.MyPreferences.portal_contact_email }}AuthorsPraekelt ConsultingShaun SephtonEuan JonkerHedley RoosChangelognextDjango 2 and Python 3.5 compatibility. Django 1.9 is no longer supported.0.2Move to tox for tests.Django 1.9 to 1.11 support. The official minimum supported version is 1.9.0.1Cleanup and fixing of tests courtesy of senyor.Rewrite distinct query so it works with Oracle backend.0.0.6Better packaging.0.0.5 (2011-08-17)Added sites support.Added unittests.0.0.4 (2011-08-11)Cleanup. Docs polish.0.0.3Spelling correction, thanks tiktuk.0.0.2Doc update to indicate importance of placing url include before admin url include.0.0.1First super alpha release.