Skip to main content

No project description provided

Project description


  • Update django settings from environment variables by updating sys.modules
  • Mostly using ast.literal_eval to convert string to python object.
  • Tested by converting all default django settings to string and back to python object and then running django command.


  • simplify code
  • verify settings after they are casted to python object
  1. Usage:
    • in myproject.settings:
      import os
      import sys
      import ast
      from djangobuk_envsettings import update_from_env
          # default prefix for all variables
          # settings that can be updated from env
          # by default all settings are allowed (this option overrides)
          # optional
          # extra settings and their types (to be used with extra_allowed)
              'DATABASE_PATH': ast.literal_eval,
          # optional
          # extra settings that can be updated from env
      # nothing more required
      DATABASES = {
          'default': {
              'ENGINE': 'django.db.backends.sqlite3',
              'NAME': DATABASE_PATH,

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

djangobuk_envsettings-0.4.1.tar.gz (5.0 kB view hashes)

Uploaded source

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