Configure django settings for multiple environments.
Project description
Django Environment Config
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file django_environment_config-0.2.2.tar.gz
.
File metadata
- Download URL: django_environment_config-0.2.2.tar.gz
- Upload date:
- Size: 12.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.7 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70d9f724328da11e870af34dd00598385fdb5534942a0fa3b3b44f13d8d1a713 |
|
MD5 | 67bd016081b5bfb7f4e35ed850a2b8e8 |
|
BLAKE2b-256 | 861104f55e84550feda761a224c05a93f21f18eb2c161e3b74129634f552f497 |
File details
Details for the file django_environment_config-0.2.2-py3-none-any.whl
.
File metadata
- Download URL: django_environment_config-0.2.2-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.7 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d085c62cc9158e2abd60bc80848e753a6ebd921226f828ea299ed6bff8da27c8 |
|
MD5 | 999f0667d2ee031d9e65e88e10489eff |
|
BLAKE2b-256 | 7bb2b14fcec28bd0841b0c413af71b6873b4d22568c71c1143ec4d85e79fd580 |