Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mrthearman/django-environment-config
Configure django settings for multiple environments.
https://github.com/mrthearman/django-environment-config
config configuration django dotenv env settings
Last synced: about 1 month ago
JSON representation
Configure django settings for multiple environments.
- Host: GitHub
- URL: https://github.com/mrthearman/django-environment-config
- Owner: MrThearMan
- License: mit
- Created: 2024-04-27T10:34:20.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-11-18T02:34:07.000Z (about 1 month ago)
- Last Synced: 2024-11-18T03:31:06.936Z (about 1 month ago)
- Topics: config, configuration, django, dotenv, env, settings
- Language: Python
- Homepage: https://pypi.org/project/django-environment-config/
- Size: 2.97 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Django Environment Config
[![Coverage Status][coverage-badge]][coverage]
[![GitHub Workflow Status][status-badge]][status]
[![PyPI][pypi-badge]][pypi]
[![GitHub][licence-badge]][licence]
[![GitHub Last Commit][repo-badge]][repo]
[![GitHub Issues][issues-badge]][issues]
[![Downloads][downloads-badge]][pypi]
[![Python Version][version-badge]][pypi]```shell
pip install django-environment-config
```---
**Documentation**: [https://mrthearman.github.io/django-environment-config/](https://mrthearman.github.io/django-environment-config/)
**Source Code**: [https://github.com/MrThearMan/django-environment-config/](https://github.com/MrThearMan/django-environment-config/)
**Contributing**: [https://github.com/MrThearMan/django-environment-config/blob/main/CONTRIBUTING.md](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.
```python
from env_config import Environment, valuesclass 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.```shell
DJANGO_SETTINGS_ENVIRONMENT=Example python manage.py runserver
```Check out the [docs] for more information.
[django-configurations]: https://github.com/jazzband/django-configurations
[docs]: https://mrthearman.github.io/django-environment-config/[coverage-badge]: https://coveralls.io/repos/github/MrThearMan/django-environment-config/badge.svg?branch=main
[status-badge]: https://img.shields.io/github/actions/workflow/status/MrThearMan/django-environment-config/test.yml?branch=main
[pypi-badge]: https://img.shields.io/pypi/v/django-environment-config
[licence-badge]: https://img.shields.io/github/license/MrThearMan/django-environment-config
[repo-badge]: https://img.shields.io/github/last-commit/MrThearMan/django-environment-config
[issues-badge]: https://img.shields.io/github/issues-raw/MrThearMan/django-environment-config
[version-badge]: https://img.shields.io/pypi/pyversions/django-environment-config
[downloads-badge]: https://img.shields.io/pypi/dm/django-environment-config[coverage]: https://coveralls.io/github/MrThearMan/django-environment-config?branch=main
[status]: https://github.com/MrThearMan/django-environment-config/actions/workflows/test.yml
[pypi]: https://pypi.org/project/django-environment-config
[licence]: https://github.com/MrThearMan/django-environment-config/blob/main/LICENSE
[repo]: https://github.com/MrThearMan/django-environment-config/commits/main
[issues]: https://github.com/MrThearMan/django-environment-config/issues