Skip to content

Python 3 Port of django-livesettings that works with Python 3.5.X and Django 1.9+


Notifications You must be signed in to change notification settings


Repository files navigation


Build Status PyPI version

This is a Python 3 Port of django-livesettings that has been tested with Python 3.X and Django up to 4.X.

django-livesettings3 provides the ability to configure settings via an admin interface, rather than by editing In addition, livesettings allows you to set sane defaults so that your site can be perfectly functional without any changes. Livesettings uses caching to make sure this has minimal impact on your site’s performance. Finally, if you wish to lock down your site and disable the settings, you can export your livesettings and store them in your This allows you have flexibility in deciding how various users interact with your app.



$ pip install git+


Adding livesettings to your project

Add livesettings to


It is high recommended to configure a global cache (like Redis) in production for multiprocess servers or you will see the outdated data.

Add livesettings.urls to urlpatterns in

urlpatterns = [
    url(r'^admin/', include(,
    url(r'^settings/', include('livesettings.urls')),

Checkout the Sample screenshot of livesetting editor


Create within your app directory where your is located. We will use to register the settings value.

from django.utils.translation import gettext_lazy as _
from livesettings.functions import config_register
from livesettings.values import ConfigurationGroup, PositiveIntegerValue, MultipleStringValue

# Config group to hold all the configs
MYAPP_GROUP = ConfigurationGroup('MyApp', _('My App Settings'), ordering=0)

# When ordering parameter is not passed, all inputs are sorted by name
    description=_('Number of images to display'),
    help_text=_("How many images to display on front page."),
    # if no help_text is given, Default falue is displayed

# Another example of allowing the user to select from several values
    description=_("Measurement System"),
    help_text=_("Default measurement system to use."),
    choices=[('metric', _('Metric')),
             ('imperial', _('Imperial'))],


To activate the you need to import config from file.

from * import config

Linter Warning: Becareful of PyCharm's Optimize Imports, it may remove this line as it is never called directly!

Accessing Values in view

You can use config_value method to read the values store in livesttings

from django.shortcuts import render
from livesettings.functions import config_value

def index(request):
    image_count = config_value('MyApp', 'NUM_IMAGES')
    # Note, the measurement_system will return a list of selected values
    # in this case, we use the first one
    measurement_system = config_value('MyApp', 'MEASUREMENT_SYSTEM')
    return render(request, 'myapp/index.html',
                  {'image_count': image_count,
                   'measurement_system': measurement_system[0]})

Security and Permissions

In order to give non-superusers access to the /settings/ views, open Django Admin Auth screen and give the user or to its group the permission livesettings|setting|Can change settting.

Checkout the permissions screenshot

The same permission is needed to view the form and submit. Permissions for insert or delete and any permissions for “long setting” are ignored.

Superusers will have access to this setting without enabling any specific permissions.

If you want to save a sensitive information to livesettings on production site (e.g. a password for logging into other web service) it is recommended not to grant permissions to livesettings to users which are logging in everyday. The most secure method is to export the settings and disable web access to livesettings as described below. Exporting settings itself is allowed only by the superuser.

Because of the security significance of livesettings, all views in livesettings support CSRF regardless of whether or not the CsrfViewMiddleware is enabled or disabled.

Exporting Settings

Settings can be exported by the . After exporting the file, the entire output can be manually copied and pasted to

Supported Data Types

Following Data Types are supported:

  • Boolean
  • Decimal
  • Duration
  • Float
  • Integer
  • Positive Integer (non negative)
  • String
  • Long string
  • Multiple strings
  • Long multiple strings
  • Module values
  • Password

List is not implemented. But it is easy to use with comma separated string. When using the value you can simply use csvstring.split(',')

Fork of


Python 3 Port of django-livesettings that works with Python 3.5.X and Django 1.9+