easily manage typed extra settings using the django admin.
Project description
django-extra-settings
config and manage extra settings using just the django admin.
Installation
- Run
pip install django-extra-settings
- Add
extra_settings
tosettings.INSTALLED_APPS
- Run
python manage.py migrate
- Run
python manage.py collectstatic
- Restart your application server
Usage
Settings
All these settings are optional, if not defined in settings.py
the default values (listed below) will be used.
# if True the template tag will fallback to django.conf.settings,
# very useful to retrieve conf settings such as DEBUG.
EXTRA_SETTINGS_FALLBACK_TO_CONF_SETTINGS = True
# the upload_to path value of settings of type 'file'
EXTRA_SETTINGS_FILE_UPLOAD_TO = 'files'
# the upload_to path value of settings of type 'image'
EXTRA_SETTINGS_IMAGE_UPLOAD_TO = 'images'
Admin
Just go to the admin where you can:
- Create a new setting
- Update an existing setting
- Delete an existing setting
Python
You can retrieve settings programmatically:
from extra_settings.models import Setting
value = Setting.get('SETTING_NAME', default='django-extra-settings')
Templates
You can retrieve settings in templates:
{% load extra_settings %}
{% get_setting 'SETTING_NAME' default='django-extra-settings' %}
Testing
# create python virtual environment
virtualenv testing_django_extra_settings
# activate virtualenv
cd testing_django_extra_settings && . bin/activate
# clone repo
git clone https://github.com/fabiocaccamo/django-extra-settings.git src && cd src
# install dependencies
pip install -r requirements.txt
# run tests
tox
# or
python setup.py test
# or
python -m django test --settings "tests.settings"
License
Released under MIT License.
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
Built Distribution
Close
Hashes for django-extra-settings-0.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a839a5d87b9498d7b16f684fec8b3be645451808ce0d0b31997b116e796bcd4 |
|
MD5 | 68b5210219c6ceb848688c00c9bf30b1 |
|
BLAKE2b-256 | 20c2c13ecb176a27fe9cd95bb122d95ee12590d0962526ac26e43c4f1febb9cf |
Close
Hashes for django_extra_settings-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a8d2f808ae0c5c88347d42bfb2bdbb924aececec1090aa4c9415499ac43cf60 |
|
MD5 | 35c0a9e9f749229455b32653411720b7 |
|
BLAKE2b-256 | 16b32a0d6b4271700fb67e851f9f7a368eca7435d454f9771fddd661e7acc0d4 |