Skip to main content

Django user preferences

Project description

Django-Userpref

django-userpref provides a abstract and reuseable framework for userspecific settings

This includes:

  • Abstract UserPref Class

  • Admin interface

  • Templates for an userspecific settings page

Basic usage

Just define a abstract model that can be used in the applications. In you app you should define something like:

from userpref.models import Userpref

class MyappSettings(Userpref):
    special_setting = models.BooleanField(default=False, verbose_name='Make me a superhero')
    another_field = models.CharField(max_length=100, default="<unset>")

    class Meta:
        verbose_name = "My Custom Setting for app Myapp"

In your application or template you can access the settings over the users attributes

{% if request.user.myappsettings.special_settings %}
    You are special man!
{% endif %}

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-userpref-0.1.0a5.tar.gz (4.2 kB view hashes)

Uploaded Source

Built Distribution

django_userpref-0.1.0a5-py2.py3-none-any.whl (5.9 kB view hashes)

Uploaded Python 2 Python 3

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