Skip to main content

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 to settings.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


Download files

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

Files for django-extra-settings, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size django_extra_settings-0.1.2-py3-none-any.whl (12.1 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size django-extra-settings-0.1.2.tar.gz (9.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page