mirror of
https://github.com/jazzband/django-constance.git
synced 2026-03-16 22:40:24 +00:00
added README
This commit is contained in:
parent
caaed42b36
commit
91dd96e13a
2 changed files with 61 additions and 0 deletions
5
AUTHORS
Normal file
5
AUTHORS
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
Jiri Barton <jbar@hosting4u.cz>
|
||||
Vojtech Jasny <voy@voy.cz>
|
||||
Roman Krejcik <farin@farin.cz>
|
||||
Jan Vesely <jave@janvesely.com>
|
||||
Ales Zoulek <ales.zoulek@gmail.com>
|
||||
56
README.rst
Normal file
56
README.rst
Normal file
|
|
@ -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.
|
||||
|
||||
Loading…
Reference in a new issue