django-environment-config


Namedjango-environment-config JSON
Version 0.1.3 PyPI version JSON
download
home_pagehttps://mrthearman.github.io/django-environment-config
SummaryConfigure django settings for multiple environments.
upload_time2024-05-07 08:00:44
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/fa/2e/1d3cac3eaaec135dfdef0c2d9f21e428d8cb99842dbf18e934108899c60e/django_environment_config-0.1.3.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.1.3",
    "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": "b0834d5aeedc762f85b9299d8294daa7b4c895296e344898fb6c5f9a57eb4f47",
                "md5": "29f57ecb28c2899d119dc205589c82fc",
                "sha256": "1f9152e5aa9ee2db8a73a712f5607095facc3a1e8d2162db32d62977271b930d"
            },
            "downloads": -1,
            "filename": "django_environment_config-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "29f57ecb28c2899d119dc205589c82fc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4,>=3.10",
            "size": 14535,
            "upload_time": "2024-05-07T08:00:42",
            "upload_time_iso_8601": "2024-05-07T08:00:42.951499Z",
            "url": "https://files.pythonhosted.org/packages/b0/83/4d5aeedc762f85b9299d8294daa7b4c895296e344898fb6c5f9a57eb4f47/django_environment_config-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fa2e1d3cac3eaaec135dfdef0c2d9f21e428d8cb99842dbf18e934108899c60e",
                "md5": "e8157cdb3d815d4dd294853eed4854c7",
                "sha256": "7e95557d06988a25aacc6551b5a51a4f1c0bb927ce0fa080238f07ad1505086d"
            },
            "downloads": -1,
            "filename": "django_environment_config-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "e8157cdb3d815d4dd294853eed4854c7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.10",
            "size": 12397,
            "upload_time": "2024-05-07T08:00:44",
            "upload_time_iso_8601": "2024-05-07T08:00:44.308073Z",
            "url": "https://files.pythonhosted.org/packages/fa/2e/1d3cac3eaaec135dfdef0c2d9f21e428d8cb99842dbf18e934108899c60e/django_environment_config-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-07 08:00:44",
    "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.25735s