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.2.2.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

django_environment_config-0.2.2-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

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

Hashes for django_environment_config-0.2.2.tar.gz
Algorithm Hash digest
SHA256 70d9f724328da11e870af34dd00598385fdb5534942a0fa3b3b44f13d8d1a713
MD5 67bd016081b5bfb7f4e35ed850a2b8e8
BLAKE2b-256 861104f55e84550feda761a224c05a93f21f18eb2c161e3b74129634f552f497

See more details on using hashes here.

File details

Details for the file django_environment_config-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for django_environment_config-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d085c62cc9158e2abd60bc80848e753a6ebd921226f828ea299ed6bff8da27c8
MD5 999f0667d2ee031d9e65e88e10489eff
BLAKE2b-256 7bb2b14fcec28bd0841b0c413af71b6873b4d22568c71c1143ec4d85e79fd580

See more details on using hashes here.

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