Skip to main content

Configure django settings for multiple environments.

Project description

Django Environment Config

Coverage Status GitHub Workflow Status PyPI GitHub GitHub Last Commit GitHub Issues Downloads Python Version

pip install django-environment-config

Documentation: https://mrthearman.github.io/django-environment-config/

Source Code: https://github.com/MrThearMan/django-environment-config/

Contributing: https://github.com/MrThearMan/django-environment-config/blob/main/CONTRIBUTING.md


Inspired by django-configurations, this library aims to provide a simple way to configure settings for different environments in Django applications. For example, you might want to have different settings for local development compared to production, and different still when running automated tests or in checks in you CI.

Overview

Environments are defined with a simple class-based configuration in the settings.py module.

from env_config import Environment, values

class Example(Environment):
    DEBUG = True
    SECRET_KEY = values.StringValue()
    ALLOWED_HOSTS = values.ListValue(default=["*"])
    DATABASES = values.DatabaseURLValue()

The Environment must be selected by setting the DJANGO_SETTINGS_ENVIRONMENT environment variable to the name of the class.

DJANGO_SETTINGS_ENVIRONMENT=Example python manage.py runserver

Check out the docs for more information.

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_environment_config-0.1.1.tar.gz (12.4 kB view hashes)

Uploaded Source

Built Distribution

django_environment_config-0.1.1-py3-none-any.whl (14.5 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