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


Download files

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

Source Distribution

django-dynsettings-0.1.0.zip (5.1 kB view details)

Uploaded Source

Built Distribution

django-dynsettings-0.1.0.win32-py2.7.exe (200.6 kB view details)

Uploaded Source

File details

Details for the file django-dynsettings-0.1.0.zip.

File metadata

File hashes

Hashes for django-dynsettings-0.1.0.zip
Algorithm Hash digest
SHA256 cca0c8a7c290b9ce5e5fb5534bac13992292c805eaa7725b2c6da24ded57a93c
MD5 c2aaf719790079fc67baca82392caabb
BLAKE2b-256 ea3ca1959187ab8a273dadd71465391ed158d6028ee835eef431797ce0e6fbe9

See more details on using hashes here.

File details

Details for the file django-dynsettings-0.1.0.win32-py2.7.exe.

File metadata

File hashes

Hashes for django-dynsettings-0.1.0.win32-py2.7.exe
Algorithm Hash digest
SHA256 585cd07132ee599f013b9c7274e3101beb42d8ac531b3faaedf2eb9d8c5bf2ac
MD5 eee256a30462cd287912d6ff56ffed05
BLAKE2b-256 0a8fa590d5fad5ace097362e7f85ba0ca742d7f88f0d5674385efef736b92f33

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page