简易的配置项获取方式,支持添加多种配置项获取源。默认从环境变量中获取配置项。
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python-environment-settings-0.1.1.tar.gz.
File metadata
- Download URL: python-environment-settings-0.1.1.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
caccc845eea073e42e7a6548edde84225c91edb11252d848a9abd4f5b28d9693
|
|
| MD5 |
117c0fe2becc706c023956cd804ad189
|
|
| BLAKE2b-256 |
5a8e557c7b30791aae9e41bccd942c169c4027a1f13ae0474ab01bc8b3a8bec2
|
File details
Details for the file python_environment_settings-0.1.1-py3-none-any.whl.
File metadata
- Download URL: python_environment_settings-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23872d246864f5ff669d30faef72e0567572d3abb1f5e58292e597e015038df8
|
|
| MD5 |
acaf0edd85ca5feebedbd2031745eb8a
|
|
| BLAKE2b-256 |
1a5909448f5d8c73e97d8cc6bb2543afd78743d2711754307833f03c3aa0b1c8
|