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.
See also
-
django-admin-interface
- the default admin interface made customizable by the admin itself. popup windows replaced by modals. 🧙 ⚡ -
django-colorfield
- simple color field for models with a nice color-picker in the admin. 🎨 -
django-maintenance-mode
- shows a 503 error page when maintenance-mode is on. 🚧 🛠️ -
django-redirects
- redirects with full control. ↪️ -
django-treenode
- probably the best abstract model / admin for your tree based stuff. 🌳 -
python-benedict
- dict subclass with keylist/keypath support, I/O shortcuts (base64, csv, json, pickle, plist, query-string, toml, xml, yaml) and many utilities. 📘 -
python-codicefiscale
- encode/decode Italian fiscal codes - codifica/decodifica del Codice Fiscale. 🇮🇹 💳 -
python-fsutil
- file-system utilities for lazy devs. 🧟♂️
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
Hashes for django-extra-settings-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42eac04c58f631bc571a181ac6399aba7f66fc48c7bcf6ff381516eac19813c0 |
|
MD5 | f2859d1b74dfb0554590981a739a323c |
|
BLAKE2b-256 | 23d5d14dc431ea3eb1f2a58f2199654a442c8e4f4dd9f031181b6a1ecc703212 |
Hashes for django_extra_settings-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9bf0ffeb76b3a3da16069d777c1f5ec50c01ad5504bedf93084aacc29419844e |
|
MD5 | 5317d31de0e267c0f83aa296090ba839 |
|
BLAKE2b-256 | 1a2cbe0f52c18c521ae256f3ca85d5c413a2478e8196d5dd5a051b9f95b2602e |