允许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
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 django-environment-settings-0.1.2.tar.gz.
File metadata
- Download URL: django-environment-settings-0.1.2.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb0c7550d6d047444e8789ea8d431639cab781d48ddbf65c0c0d8e5bc9d32197
|
|
| MD5 |
5c69dc97fe5da485f2e0d8f850081ceb
|
|
| BLAKE2b-256 |
dbabfe75f0b5993796c68d17a939a75fc28276a30cb002a4843514fbec5ac726
|
File details
Details for the file django_environment_settings-0.1.2-py3-none-any.whl.
File metadata
- Download URL: django_environment_settings-0.1.2-py3-none-any.whl
- Upload date:
- Size: 6.3 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 |
d92726790727847967b65801f34c59416a67e66a8602e61f9ed172b04824f900
|
|
| MD5 |
4cf625ca569bcf09a0e776fc7845f3fb
|
|
| BLAKE2b-256 |
685bcdf51e1e1c1b82947cd62e131fd8604a5d10f75223bc79cd63cf0927d3c1
|