Settings options

Settings options default values are set to ensure consistency with django settings behavior. Most of the smartness, unicorns and rainbows are not enabled by default.


Environment variable to set to point at flexisettings.settings, more details in the django documentation. This can be set by environment variable either on the command line, in or in myproject/


Environment variable to set to point at your django settings, this environment variable has to be set for flexisettings to work. This can be set by environmentvariable either on the command line, in or in myproject/


Default: None

String defining the running environment, used when trying to load settings depending on the defined running environment.


Default: ['apps', 'lib']

List of paths to add to sys.path if they exist, this will be done if FLEXI_LAYOUT_DISCOVERY is True.


Default: True (this is django default behavior)

Boolean affecting the autoreload machinery for settings. If set to True, it should make the django autoreload code work when changing any settings file found in flexisettings.settings._wrapped_modules. If set to False, the autoreload will not work on settings. The code is a bit tricky, not guaranteed to work and might have unsuspected effects, hence the possibility to disable.


Default: False

Boolean that determines if flexisettings tries to be smart about your project layout. It will add any FLEXI_MEDIA_FOLDER, FLEXI_STATIC_FOLDER, FLEXI_TEMPLATE_FOLDERS folder to the appropriate configuration variables if they are not already set.


Default: 'media'

The media folder name to look for when doing layout discovery.


Default: 'static'

The static folder name to look for when doing layout discovery.


Default: ('templates', )

A tuple of templates folder names to look for when doing layout discovery.



Path to the site root, everything that should not be tracked in a VCS but is still part of your website. For example, the MEDIA_ROOT folder should reside in the site root.


Default: dirname() of the settings folder

Path to the django project, basically everything that should be tracked in a VCS.

Example configuration

  • edit to set the working environment, let’s use prod here:

    $ cat myproject/
    # environment declaration
    FLEXI_RUN_ENV = 'prod'
  • edit to set the SECRET_KEY value:

    $ grep SECRET_KEY myproject/
    SECRET_KEY = 'alongandcomplexsecretstring'
  • set security variables in to be used in any settings file:

    $ grep DEFAULTDB myproject/
    DEFAULTDB_NAME = 'dbname'
    DEFAULTDB_USER = 'dbuser'
    DEFAULTDB_PWD = 'secret'
  • edit to override generic settings like DATABASES, MEDIA_ROOT, TIME_ZONE:

    $ cat myproject/settings/
        'default': {
            'ENGINE': 'django.db.backends.postgresql_psycopg2',
            'NAME': DEFAULTDB_NAME,
            'USER': DEFAULTDB_USER,
            'HOST': '',
            'PORT': '',