Skip to main content

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

Project description

django-environment-settings

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

安装

pip install django-environment-settings

使用

app/settings.py

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以增强兼容性。

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-settings-0.1.2.tar.gz (6.2 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_settings-0.1.2-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file django-environment-settings-0.1.2.tar.gz.

File metadata

File hashes

Hashes for django-environment-settings-0.1.2.tar.gz
Algorithm Hash digest
SHA256 cb0c7550d6d047444e8789ea8d431639cab781d48ddbf65c0c0d8e5bc9d32197
MD5 5c69dc97fe5da485f2e0d8f850081ceb
BLAKE2b-256 dbabfe75f0b5993796c68d17a939a75fc28276a30cb002a4843514fbec5ac726

See more details on using hashes here.

File details

Details for the file django_environment_settings-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for django_environment_settings-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d92726790727847967b65801f34c59416a67e66a8602e61f9ed172b04824f900
MD5 4cf625ca569bcf09a0e776fc7845f3fb
BLAKE2b-256 685bcdf51e1e1c1b82947cd62e131fd8604a5d10f75223bc79cd63cf0927d3c1

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