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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_environment_config-0.2.3-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file django_environment_config-0.2.3.tar.gz.

File metadata

  • Download URL: django_environment_config-0.2.3.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.0 CPython/3.13.5 Linux/6.11.0-1018-azure

File hashes

Hashes for django_environment_config-0.2.3.tar.gz
Algorithm Hash digest
SHA256 17d8b338686045a73cb6a7a4784ba88e892bccfd1e8cf9bef6d3a59a68514fc6
MD5 f61efdc62178a24fbb878f63a20318b4
BLAKE2b-256 01b9f5f06010d099ae13b6538ffbbf98ba7e7e36dc80d1f8b22028e0e420fb87

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_environment_config-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 401eb6670a4316e4e7c87623d847040bbe35d58321404a61c4d6ddfc44aa7ce0
MD5 12bd289cae6c493055181a7a1bd28abd
BLAKE2b-256 4cb8e03b4fbc52fc37c371bde1657c329a3a4711096ee78ad3d926072e96793f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page