From 91dd96e13a17d984fc724f9274edfddc69e0110d Mon Sep 17 00:00:00 2001 From: Jiri Barton Date: Wed, 25 Aug 2010 10:30:58 +0200 Subject: [PATCH] added README --- AUTHORS | 5 +++++ README.rst | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 AUTHORS create mode 100644 README.rst diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..cefd0c1 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,5 @@ +Jiri Barton +Vojtech Jasny +Roman Krejcik +Jan Vesely +Ales Zoulek diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..b3e361b --- /dev/null +++ b/README.rst @@ -0,0 +1,56 @@ +Dynamic Django settings in Redis. + +Features +======== + +* Easy migrate your static settings to dynamic settings. +* Admin interface to edit the dynamic settings. + +Installation +============ + +Install from here using ``pip``:: + + pip install -e hg+http://bitbucket.org/comoga/django-constance#egg=django-constance + +1. Add ``constance`` to your ``INSTALLED_APPS``. + +2. Point ``CONSTANCE_CONNECTION`` in your ``settings.py`` to your Redis instance, like this:: + + CONSTANCE_CONNECTION = { + 'host': 'localhost', + 'port': 6379, + 'db': 0, + } + +3. Create an empty section ``CONSTANCE_CONFIG`` in your settings which will + enumerate all your dynamic settings for the admin:: + + CONSTANCE_CONFIG = { + } + +Usage +===== + +Add + +:: + + from constance import config + +to the top of your source and replace ``settings.MY_SETTINGS_KEY`` with +``config.MY_SETTINGS_KEY`` for each key which you want to be read +from Redis. + +Next, move each such key within your ``settings.py`` to the ``CONSTANCE_CONFIG`` +section. Keep the default value and add an explanation for the admin, like +this:: + + CONSTANCE_CONFIG = { + 'MY_SETTINGS_KEY': (42, 'the answer to everything'), + } + + +Fire up your ``admin`` and you should see a new application ``Constance`` +with ``MY_SETTINGS_KEY`` in the ``Config`` pseudo model. +