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
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 | RSS feed
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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django-dynsettings-0.1.0.zip.
File metadata
- Download URL: django-dynsettings-0.1.0.zip
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cca0c8a7c290b9ce5e5fb5534bac13992292c805eaa7725b2c6da24ded57a93c
|
|
| MD5 |
c2aaf719790079fc67baca82392caabb
|
|
| BLAKE2b-256 |
ea3ca1959187ab8a273dadd71465391ed158d6028ee835eef431797ce0e6fbe9
|
File details
Details for the file django-dynsettings-0.1.0.win32-py2.7.exe.
File metadata
- Download URL: django-dynsettings-0.1.0.win32-py2.7.exe
- Upload date:
- Size: 200.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
585cd07132ee599f013b9c7274e3101beb42d8ac531b3faaedf2eb9d8c5bf2ac
|
|
| MD5 |
eee256a30462cd287912d6ff56ffed05
|
|
| BLAKE2b-256 |
0a8fa590d5fad5ace097362e7f85ba0ca742d7f88f0d5674385efef736b92f33
|