Skip to main content

Django Dynamic Settings

Project description

====================
Django Dynamic Settings
====================

Installation
============

1. Add ``dynsettings`` to your ``INSTALLED_APPS``:
<pre>
INSTALLED_APPS = (
...
'dynsettings',
)
</pre>

2. Run syncdb to create dynsettings table.

Usage
=============

1. Import dynsettings object to manipulate your settings:
<pre>
from dynsettings.models import dynsettings
</pre>

2. Define your initial settings values in your settings.py (optional):
<pre>
DYNSETTINGS = {
'my_initial_data': 12345
}
</pre>

3. Use dynamic settings like a dictionary:
<pre>
import datetime

dynsettings['my_data_name'] = u'Today is'
dynsettings['my_data_name2'] = datetime.datetime.now()

print dynsettings['my_data_name'], dynsettings['my_data_name2'].strftime("%d/%m/%Y")
print dynsettings['my_initial_data']

dynsettings['my_initial_data'] = "abcd"

print dynsettings['my_initial_data']
</pre>

The code above will print the following output: <br />
\>\>\> Today is 18/01/2013 <br />
\>\>\> 12345<br />
\>\>\> abcd

Project details


Release history Release notifications

This version
History Node

0.1.0

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
django-dynsettings-0.1.0.win32-py2.7.exe (200.6 kB) Copy SHA256 hash SHA256 Windows Installer any Jan 20, 2013
django-dynsettings-0.1.0.zip (5.1 kB) Copy SHA256 hash SHA256 Source None Jan 20, 2013

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page