This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Some site wide settings belong in the database. This Django-Configure provides a familiar way to implement this pattern. It uses django-polymorphic, mostly to provide a clean admin interface. Any model field can be used in a configuration, and any of the standard django admin utilities (like permissions) can be used.

Installation

Install from pypi using your favorite method::

pip install django-configuration

Usage

In myapp/models.py::

from configuration.models import Configuration

class MyConfiguration(Configuration):
    my_var = models.CharField(max_length=255, default='Hello!')

Then elsewhere::

>>> from myapp.models import MyConfiguration
>>> print MyConfiguration.objects.get()
Hello!

A Configuration instance is not saved to the database until save is explicitly called or until it is saved in the admin, so it is important to specify default values on your fields.

A custom admin interface can be provided as follows::

from configuration.models import Configuration
from configuration.admin import ConfigurationAdmin

class MyAdmin(ConfigurationAdmin):
    pass

class MyConfiguration(Configuration):
    my_var = models.CharField(max_length=255, default='Hello!')

    admin_class = MyAdmin

The admin class must inherit from ConfigurationAdmin. The admin_class attribute can also be given as a dotted string::

class MyConfiguration(Configuration):
    my_var = models.CharField(max_length=255, default='Hello!')

    admin_class = 'myapp.admin.MyAdmin'

Efficiency and Caching

Django-Configuration is quick, easy and intuitive, and allows you to follow django patterns. However it is not the most efficient method of keeping configuration optinos in the database. The use of django-polymorphic allows for a great admin interface but makes queries more costly. The library currently provides no caching - although caching apps that cache query results should help with that.

Release History

Release History

0.0.3

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-configuration-0.0.3.zip (8.5 kB) Copy SHA256 Checksum SHA256 Source Apr 1, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting