Skip to main content

简易的配置项获取方式,支持添加多种配置项获取源。默认从环境变量中获取配置项。

Project description

python-environment-settings

简易的配置项获取方式,支持添加多种配置项获取源。默认从环境变量中获取配置项。

安装

pip install python-environment-settings

使用

from django.conf import settings
import python_environment_settings

python_environment_settings.add_settings(settings)

CONFIG1 = python_environment_settings.get(
    "CONFIG1",
    default="DEFAULT_VALUE1",
    aliases=[
        "config1",
        "item1",
        "key1",
    ]
)

版本记录

v0.1.0

  • 版本首发。

v0.1.1

  • 允许添加优先级高于env的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

python-environment-settings-0.1.1.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_environment_settings-0.1.1-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file python-environment-settings-0.1.1.tar.gz.

File metadata

File hashes

Hashes for python-environment-settings-0.1.1.tar.gz
Algorithm Hash digest
SHA256 caccc845eea073e42e7a6548edde84225c91edb11252d848a9abd4f5b28d9693
MD5 117c0fe2becc706c023956cd804ad189
BLAKE2b-256 5a8e557c7b30791aae9e41bccd942c169c4027a1f13ae0474ab01bc8b3a8bec2

See more details on using hashes here.

File details

Details for the file python_environment_settings-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for python_environment_settings-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 23872d246864f5ff669d30faef72e0567572d3abb1f5e58292e597e015038df8
MD5 acaf0edd85ca5feebedbd2031745eb8a
BLAKE2b-256 1a5909448f5d8c73e97d8cc6bb2543afd78743d2711754307833f03c3aa0b1c8

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