django-environment-config


Namedjango-environment-config JSON
Version 0.2.2 PyPI version JSON
download
home_pagehttps://mrthearman.github.io/django-environment-config
SummaryConfigure django settings for multiple environments.
upload_time2024-10-14 17:55:19
maintainerNone
docs_urlNone
authorMatti Lamppu
requires_python<4,>=3.10
licenseMIT
keywords django configuration settings environment env config
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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, 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.

```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

            

Raw data

            {
    "_id": null,
    "home_page": "https://mrthearman.github.io/django-environment-config",
    "name": "django-environment-config",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4,>=3.10",
    "maintainer_email": null,
    "keywords": "django, configuration, settings, environment, env, config",
    "author": "Matti Lamppu",
    "author_email": "lamppu.matti.akseli@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/86/11/04f55e84550feda761a224c05a93f21f18eb2c161e3b74129634f552f497/django_environment_config-0.2.2.tar.gz",
    "platform": null,
    "description": "# Django Environment Config\n\n[![Coverage Status][coverage-badge]][coverage]\n[![GitHub Workflow Status][status-badge]][status]\n[![PyPI][pypi-badge]][pypi]\n[![GitHub][licence-badge]][licence]\n[![GitHub Last Commit][repo-badge]][repo]\n[![GitHub Issues][issues-badge]][issues]\n[![Downloads][downloads-badge]][pypi]\n[![Python Version][version-badge]][pypi]\n\n```shell\npip install django-environment-config\n```\n\n---\n\n**Documentation**: [https://mrthearman.github.io/django-environment-config/](https://mrthearman.github.io/django-environment-config/)\n\n**Source Code**: [https://github.com/MrThearMan/django-environment-config/](https://github.com/MrThearMan/django-environment-config/)\n\n**Contributing**: [https://github.com/MrThearMan/django-environment-config/blob/main/CONTRIBUTING.md](https://github.com/MrThearMan/django-environment-config/blob/main/CONTRIBUTING.md)\n\n---\n\nInspired by [django-configurations], this library aims to provide a simple way to configure\nsettings for different environments in Django applications. For example, you might want to\nhave different settings for local development compared to production, and different still when\nrunning automated tests or in checks in you CI.\n\n## Overview\n\nEnvironments are defined with a simple class-based configuration in the `settings.py` module.\n\n```python\nfrom env_config import Environment, values\n\nclass Example(Environment):\n    DEBUG = True\n    SECRET_KEY = values.StringValue()\n    ALLOWED_HOSTS = values.ListValue(default=[\"*\"])\n    DATABASES = values.DatabaseURLValue()\n```\n\nThe Environment must be selected by setting the `DJANGO_SETTINGS_ENVIRONMENT`\nenvironment variable to the name of the class.\n\n```shell\nDJANGO_SETTINGS_ENVIRONMENT=Example python manage.py runserver\n```\n\nCheck out the [docs] for more information.\n\n[django-configurations]: https://github.com/jazzband/django-configurations\n[docs]: https://mrthearman.github.io/django-environment-config/\n\n[coverage-badge]: https://coveralls.io/repos/github/MrThearMan/django-environment-config/badge.svg?branch=main\n[status-badge]: https://img.shields.io/github/actions/workflow/status/MrThearMan/django-environment-config/test.yml?branch=main\n[pypi-badge]: https://img.shields.io/pypi/v/django-environment-config\n[licence-badge]: https://img.shields.io/github/license/MrThearMan/django-environment-config\n[repo-badge]: https://img.shields.io/github/last-commit/MrThearMan/django-environment-config\n[issues-badge]: https://img.shields.io/github/issues-raw/MrThearMan/django-environment-config\n[version-badge]: https://img.shields.io/pypi/pyversions/django-environment-config\n[downloads-badge]: https://img.shields.io/pypi/dm/django-environment-config\n\n[coverage]: https://coveralls.io/github/MrThearMan/django-environment-config?branch=main\n[status]: https://github.com/MrThearMan/django-environment-config/actions/workflows/test.yml\n[pypi]: https://pypi.org/project/django-environment-config\n[licence]: https://github.com/MrThearMan/django-environment-config/blob/main/LICENSE\n[repo]: https://github.com/MrThearMan/django-environment-config/commits/main\n[issues]: https://github.com/MrThearMan/django-environment-config/issues\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Configure django settings for multiple environments.",
    "version": "0.2.2",
    "project_urls": {
        "Bug Tracker": "https://github.com/MrThearMan/django-environment-config/issues",
        "Homepage": "https://mrthearman.github.io/django-environment-config",
        "Repository": "https://github.com/MrThearMan/django-environment-config"
    },
    "split_keywords": [
        "django",
        " configuration",
        " settings",
        " environment",
        " env",
        " config"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7bb2b14fcec28bd0841b0c413af71b6873b4d22568c71c1143ec4d85e79fd580",
                "md5": "999f0667d2ee031d9e65e88e10489eff",
                "sha256": "d085c62cc9158e2abd60bc80848e753a6ebd921226f828ea299ed6bff8da27c8"
            },
            "downloads": -1,
            "filename": "django_environment_config-0.2.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "999f0667d2ee031d9e65e88e10489eff",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4,>=3.10",
            "size": 14919,
            "upload_time": "2024-10-14T17:55:18",
            "upload_time_iso_8601": "2024-10-14T17:55:18.190146Z",
            "url": "https://files.pythonhosted.org/packages/7b/b2/b14fcec28bd0841b0c413af71b6873b4d22568c71c1143ec4d85e79fd580/django_environment_config-0.2.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "861104f55e84550feda761a224c05a93f21f18eb2c161e3b74129634f552f497",
                "md5": "67bd016081b5bfb7f4e35ed850a2b8e8",
                "sha256": "70d9f724328da11e870af34dd00598385fdb5534942a0fa3b3b44f13d8d1a713"
            },
            "downloads": -1,
            "filename": "django_environment_config-0.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "67bd016081b5bfb7f4e35ed850a2b8e8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.10",
            "size": 12633,
            "upload_time": "2024-10-14T17:55:19",
            "upload_time_iso_8601": "2024-10-14T17:55:19.705782Z",
            "url": "https://files.pythonhosted.org/packages/86/11/04f55e84550feda761a224c05a93f21f18eb2c161e3b74129634f552f497/django_environment_config-0.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-14 17:55:19",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "MrThearMan",
    "github_project": "django-environment-config",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "django-environment-config"
}
        
Elapsed time: 0.35539s