django-environment-settings


Namedjango-environment-settings JSON
Version 0.1.2 PyPI version JSON
download
home_pageNone
Summary允许Django应用从settings.py或环境变量中获取配置。
upload_time2024-12-24 14:00:06
maintainerrRR0VrFP
docs_urlNone
authorrRR0VrFP
requires_pythonNone
licenseApache License, Version 2.0
keywords django settings environment
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # django-environment-settings

允许Django应用从settings.py或环境变量中获取配置。

## 安装

```shell
pip install django-environment-settings
```

## 使用

*app/settings.py*

```python
import django_environment_settings

APP_CONFIG1 = django_environment_settings.get(
    "APP_CONFIG_KEY1",
    "DEFAULT_VALUE",
    aliases=[
        "APP_CONFIG_KEY1_ALIAS1",
        "APP_CONFIG_KEY1_ALIAS2"
    ],
)
```

## 版本

### 0.1.1

- 版本首发。

### 0.1.2

- 使用`python_environment_settings`以增强兼容性。

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "django-environment-settings",
    "maintainer": "rRR0VrFP",
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "django, settings, environment",
    "author": "rRR0VrFP",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/db/ab/fe75f0b5993796c68d17a939a75fc28276a30cb002a4843514fbec5ac726/django-environment-settings-0.1.2.tar.gz",
    "platform": null,
    "description": "# django-environment-settings\r\n\r\n\u5141\u8bb8Django\u5e94\u7528\u4ecesettings.py\u6216\u73af\u5883\u53d8\u91cf\u4e2d\u83b7\u53d6\u914d\u7f6e\u3002\r\n\r\n## \u5b89\u88c5\r\n\r\n```shell\r\npip install django-environment-settings\r\n```\r\n\r\n## \u4f7f\u7528\r\n\r\n*app/settings.py*\r\n\r\n```python\r\nimport django_environment_settings\r\n\r\nAPP_CONFIG1 = django_environment_settings.get(\r\n    \"APP_CONFIG_KEY1\",\r\n    \"DEFAULT_VALUE\",\r\n    aliases=[\r\n        \"APP_CONFIG_KEY1_ALIAS1\",\r\n        \"APP_CONFIG_KEY1_ALIAS2\"\r\n    ],\r\n)\r\n```\r\n\r\n## \u7248\u672c\r\n\r\n### 0.1.1\r\n\r\n- \u7248\u672c\u9996\u53d1\u3002\r\n\r\n### 0.1.2\r\n\r\n- \u4f7f\u7528`python_environment_settings`\u4ee5\u589e\u5f3a\u517c\u5bb9\u6027\u3002\r\n",
    "bugtrack_url": null,
    "license": "Apache License, Version 2.0",
    "summary": "\u5141\u8bb8Django\u5e94\u7528\u4ecesettings.py\u6216\u73af\u5883\u53d8\u91cf\u4e2d\u83b7\u53d6\u914d\u7f6e\u3002",
    "version": "0.1.2",
    "project_urls": null,
    "split_keywords": [
        "django",
        " settings",
        " environment"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "685bcdf51e1e1c1b82947cd62e131fd8604a5d10f75223bc79cd63cf0927d3c1",
                "md5": "4cf625ca569bcf09a0e776fc7845f3fb",
                "sha256": "d92726790727847967b65801f34c59416a67e66a8602e61f9ed172b04824f900"
            },
            "downloads": -1,
            "filename": "django_environment_settings-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4cf625ca569bcf09a0e776fc7845f3fb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 6310,
            "upload_time": "2024-12-24T14:00:05",
            "upload_time_iso_8601": "2024-12-24T14:00:05.615726Z",
            "url": "https://files.pythonhosted.org/packages/68/5b/cdf51e1e1c1b82947cd62e131fd8604a5d10f75223bc79cd63cf0927d3c1/django_environment_settings-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dbabfe75f0b5993796c68d17a939a75fc28276a30cb002a4843514fbec5ac726",
                "md5": "5c69dc97fe5da485f2e0d8f850081ceb",
                "sha256": "cb0c7550d6d047444e8789ea8d431639cab781d48ddbf65c0c0d8e5bc9d32197"
            },
            "downloads": -1,
            "filename": "django-environment-settings-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "5c69dc97fe5da485f2e0d8f850081ceb",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 6221,
            "upload_time": "2024-12-24T14:00:06",
            "upload_time_iso_8601": "2024-12-24T14:00:06.761071Z",
            "url": "https://files.pythonhosted.org/packages/db/ab/fe75f0b5993796c68d17a939a75fc28276a30cb002a4843514fbec5ac726/django-environment-settings-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-24 14:00:06",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "django-environment-settings"
}
        
Elapsed time: 0.50139s