8000 GitHub - belkka/django-extra-settings: config and manage extra settings using just the django admin. :gear:
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

belkka/django-extra-settings

 
 

Repository files navigation

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 3.7 virtual environment
virtualenv testing_django_extra_settings -p "python3.7"

# 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
python setup.py test
# or
python manage.py test --settings "tests.settings"

License

Released under MIT License.

About

config and manage extra settings using just the django admin. ⚙️

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 94.6%
  • JavaScript 4.8%
  • CSS 0.6%
0