python project load config from yaml or environment.
Project description
Abir--Python项目配置读取方案,yaml/environ
安装
pip install abir
快速上手
django project
- 在
settings.py
底部添加
import abir # at the top of settings.py
# another settings
abir.load()
- 在项目首页添加
configure.yaml
DATABASES.default.ENGINE: 'django.db.backends.postgresql'
DATABASES.default.NAME: 'db_name'
CACHE:
default:
BACKEND: 'django_redis.cache.RedisCache'
LOCATION: 'redis://127.0.0.1:6379/1'
OPTIONS:
CLIENT_CLASS: 'django_redis.client.DefaultClient'
LANGUAGE_CODE: 'zh-CN'
USE_TZ: true
ALLOWED_HOSTS:
- *
⚠️ 注意:dot.
将会查询settings.py
,并更新查询路径下的值。
- 启动服务。
python manmage.py runserver
# or wsgi
environment
ABIR_USE_TZ:json=false
ABIR_LANGUAGE_CODE=es-us
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
abir-0.1.3.tar.gz
(4.0 kB
view hashes)
Built Distribution
abir-0.1.3-py3-none-any.whl
(4.7 kB
view hashes)