Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Django live settings with pluggable backends, including Redis. Leonardo Fork from Jannis Leidel

Project Description
Constance - Dynamic Django settings
===================================

This is adopted version of standard library for Leonardo CMS.

Additionaly features:

* boolean, numbers, strings, dictionaries
* support for Django 1.8 +
* basic grouping via ``CONSTANCE_CONFIG_GROUPS`` which makes tabs for django admin
* access to config keys from standard django settings
* really live settings, set every value to django settings and respect the default value from them

.. code-block:: python

CONSTANCE_CONFIG = {
'MEDIA_ENABLED': (True, 'Help Text'),
'MEDIA_THUMBNAILS': ({
'SMALL': '64x64',
'MEDIUM': '265x265',
}, 'Help Text')
}

.. code-block:: python

CONSTANCE_CONFIG_GROUPS = {'Group 1': {
MY_AWESOME_KEY: ('default', help text)
}
}

.. code-block:: python

from django.conf import settings

settings.MY_AWESOME_KEY

settings.py

.. code-block:: python

DEBUG = True

CONSTANCE_CONFIG_GROUPS = {'Group 1': {
DEBUG: (False, help text)
}
}

from django.conf import settings
settings.DEBUG
-> True

after setting up value in the admin to False::

from django.conf import settings
settings.DEBUG
-> False

If you can add your custom field types, you can use the
`CONSTANCE_ADDITIONAL_FIELDS` variable. Note that you must
use later evaluated strings instead of direct classes:

.. code-block:: python
CONSTANCE_ADDITIONAL_FIELDS = {
'yes_no_null_select': ['django.forms.fields.ChoiceField',
{
'widget': 'django.forms.Select',
'choices': (("-----", None), ("yes", "Yes"), ("no", "No"))
}],
}

CONSTANCE_CONFIG = {
'MY_SELECT_KEY': ('yes', 'select yes or no', 'yes_no_null_select'),
}

.. image:: https://secure.travis-ci.org/jezdez/django-constance.png
:alt: Build Status
:target: http://travis-ci.org/jezdez/django-constance

A Django app for storing dynamic settings in pluggable backends (Redis and
Django model backend built in) with an integration with the Django admin app.

For more information see the documentation at:

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

If you have questions or have trouble using the app please file a bug report
at:

https://github.com/jezdez/django-constance/issues
Release History

Release History

This version
History Node

1.0.0.0a10.dev1

History Node

1.0.0.0a9

History Node

1.0.0.0a9.dev2

History Node

1.0.0.0a8

History Node

1.0.0a7

History Node

1.0.0a6

History Node

1.0.0.0a5

History Node

1.0.0a4

History Node

1.0.0.0a3

History Node

1.0.0a2

History Node

1.0.0a1

History Node

1.0.0a

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
leonardo-constance-1.0.0.0a10.dev1.tar.gz (124.8 kB) Copy SHA256 Checksum SHA256 Source Aug 1, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS 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