Skip to main content

Easy to manage Config variables separate from App code. Useful while developing and deploying( CI/CD) django web-apps

Project description


Project configuration variables are declared beforehand and inferred from environment variables or configuration files. Useful while developing and deploying( CI/CD) django web-apps

PyPi Version Python Version


pip install dynamic-conf


  • supports .env or .py files
  • supports casting with type annotations
  • You also don't need to include a sample file. Since the Config object would be able to generate itself.
  • It also loads Configuration variables from environment variables. The order of preference is env variables >
  • Attributes are lazily evaluated.

Getting Started

  • You need to subclass the Config class.
  • The config file should define all the variables needed for a project.
# project/

from dynamic_conf import Config, REQUIRED

class CONFIG(Config):
    """singleton to be used for configuring from os.environ and"""

    # default settings

    ENV = "prod" # optional field with a default value

    DB_NAME = "db"
    DB_HOST = ""
    DB_USER = "postgres"
    DB_PASS = None # even None could be given as default value

    SECRET_KEY:str # Python 3 only
    AN_SECRET_KEY = REQUIRED # Python 2 & 3
  • to create project/ just run with the path to CONFIG class's module
# you could pass environment variables or set already with export
env DB_PASS='123' dynamic-conf project/

dynamic-conf project/ DB_USER='user-1' DB_PASS='123' # pass as list of key-value pair

#to filter environment variables with a prefix
env VARS_PREFIX="PROD_" dynamic-conf project/ PROD_DB_USER="user-2"


  • To use the config simply import and use particular attribute
# project/
from conf import CONFIG
    "default": {
        "ENGINE": "django.contrib.gis.db.backends.postgis",
        "PORT": "5432",

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

dynamic-conf-1.0.1.tar.gz (6.8 kB view hashes)

Uploaded source

Built Distribution

dynamic_conf-1.0.1-py3-none-any.whl (7.8 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page