Skip to main content

A re-useable Django app for building models that modify Django settings.

Project description

Settings Model

TravisCI PyPI Coveralls Code Style

Documentation: https://django-settings-model.readthedocs.io

Source: https://github.com/gregschmit/django-settings-model

PyPI: https://pypi.org/project/django-settings-model/

This Django reusable app implements a base SettingsModel class to allow settings to be edited and saved in the database. For any particular project, you probably want to customize which settings are exposed, so while there is a Settings example implementation that you can use, the abstract model SettingsModel can be used to construct your own settings model(s), and things like webserver restarts are handled in the abstract model class.

The Problem: Sometimes you want to build an app that can run on an arbitrary piece of equipment, and things like timezone, hostname, or SMTP settings may need to be editable from the UI.

The Solution: This app implements a base SettingsModel class that allows you to expose settings to a user interface via the database.

How to Use

$ pip install django-settings-model

You can either create your own custom Settings model, inheriting from settings_model.models.SettingsModel. An example implementation is provided in the settings_model.models.Settings model. If you include settings_model in your INSTALLED_APPS, then that model will be migrated to your database when you run python3 manage.py migrate and you will see the settings in the Admin site.

Settings

  • SETTINGS_MODEL_REBOOT_FILES (default []): This is a list of files that should be touched when the settings model is saved to signal to the webserver to update. If it is falsy, then the system will try to find and touch the file BASE_DIR/manage.py and the wsgi.py file defined by WSGI_APPLICATION.

Contributing

Submit a pull request if you would like to contribute. You must only contribute code that you have authored or otherwise hold the copyright to, and you must make any contributions to this project available under the 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.

Source Distribution

django-settings-model-0.2.0.tar.gz (12.3 kB view hashes)

Uploaded Source

Built Distribution

django_settings_model-0.2.0-py3-none-any.whl (15.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page