Skip to main content

A Django app to save app settings in DB as classes.

Project description

django-db-settings is a Django app to save your configuration in cacheable DB objects that are easily defined like classes.

Quick start

  1. Add “settings” to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = [
        ...
        'settings',
    ]
  2. Include the settings URLconf in your project urls.py like this:

    path('settings/', include('settings.urls')),
  3. Run python manage.py migrate to create the settings models.

  4. Start the development server and visit http://127.0.0.1:8000/admin/ to setup your app settings (you’ll need the Admin app enabled).

  5. Visit http://127.0.0.1:8000/settings/?setting=YOUR_SETTING to get the objects related to that specific setting (JSON).

  6. Find the REFRESH SETTINGS button with in Value model change list page. This project uses TTL based cache, which can be configured by adding the following setting:

    • SETTINGS_CACHE_MAXSIZE: To set the maximum size of total items in the cache. By default set to 100.

    • SETTINGS_CACHE_TTL: To set the Time To Live of the cache items. By default set to 3600 seconds (1 hour).

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-db-settings-1.0.0.tar.gz (15.9 kB view hashes)

Uploaded Source

Built Distribution

django_db_settings-1.0.0-py3-none-any.whl (17.9 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