Metadata-Version: 2.1
Name: abir
Version: 0.1.3
Summary: python project load config from yaml or environment.
Home-page: https://github.com/MattiooFR/package_name
License: MIT
Keywords: pyyaml,django,django config yaml,python configure
Author: Jone
Author-email: zjhjin@live.com
Requires-Python: >=3.6,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: PyYAML (>=6.0,<7.0)
Project-URL: Repository, https://github.com/MattiooFR/package_name
Description-Content-Type: text/markdown

# Abir--Python项目配置读取方案，yaml/environ

## 安装
```shell
pip install abir
```

## 快速上手
#### django project

1. 在 `settings.py` 底部添加

```python
import abir  # at the top of settings.py

# another settings

abir.load()
```

2. 在项目首页添加`configure.yaml`
```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`，并更新查询路径下的值。 

3. 启动服务。
```shell
python manmage.py runserver
# or wsgi
```

## environment
```shell
ABIR_USE_TZ:json=false
ABIR_LANGUAGE_CODE=es-us
```

