Repository Details
Shared by
HelloGitHub Rating
0 ratings
帮你更好的管理 Python 项目中敏感配置信息的开源三方库
Past 6 days Received 4 stars ✨
Use arrow keys to explore dates, Home and End for the first and last date, Escape to dismiss.| Date | Star | Daily change |
|---|---|---|
| 周二 | 8,917 | — |
| 周三 | 8,920 | +3 |
| 周四 | 8,920 | 0 |
| 周五 | 8,920 | 0 |
| 周六 | 8,920 | 0 |
| 周日 | 8,921 | +1 |
8.9k
Stars
No
Chinese
Python
Language
Yes
Active
123
Contributors
123
Issues
No
Organization
None
Latest
619
Forks
BSD-3-Clause
License
帮你更好的管理 Python 项目中敏感配置信息的开源三方库。在项目中会有一些数据库、账户、KEY 等敏感信息,这些信息最好不要写在源代码中。为了降低泄漏风险,一般会通过环境变量来设置,这个库可以很方便帮你在 Python 项目中管理这些信息。示例代码:
```python
# 安装:pip install -U python-dotenv
# 目录结构:
.
├── .env
└── settings.py
# 示例代码
# settings.py
import os
from dotenv import load_dotenv
load_dotenv()
SECRET_KEY = os.getenv("EMAIL")
DATABASE_PASSWORD = os.getenv("DATABASE_PASSWORD")
```
Included in:
Vol.52
Comments
Rating:
No comments yet