env-credentials-0.1.0
توضیحات
A library to maintain and use encrypted .env files.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | env-credentials-0.1.0 |
| نام | env-credentials |
| نسخه کتابخانه | 0.1.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Chris Muthig |
| ایمیل نویسنده | camuthig@gmail.com |
| آدرس صفحه اصلی | https://github.com/camuthig/python-env-credentials |
| آدرس اینترنتی | https://pypi.org/project/env-credentials/ |
| مجوز | MIT |
# Env Credentials
Manage environment variables use the dotenv pattern with encrypted files.
This project is an attempted port of the [credentials pattern](https://edgeguides.rubyonrails.org/security.html#custom-credentials)
found in Ruby on Rails.
## Installation
Using pip:
```bash
pip install env-credentials[django]
```
Using poetry:
```bash
poetry add env-credentials[django]
```
## Usage
Initializing and editing the encrypted credentials file is only supported with Django at this time. Additional CLI
tooling can be built for framework-less projects or projects using other frameworks.
### Django
After adding the dependency to your project, add the Django app
```python
INSTALLED_APPS = [
# ...
'django_credentials',
# ...
]
```
You can then initialize the credentials files with
```bash
./manage.py init_credentials
```
This will create a two new files called `master.key` and `credentials.env.enc` in your root folder. If a `.gitignore`
file exists in the same directory, it will also add `master.key` to it.
**Be sure to ignore your master.key file if the gitignore file cannot be automatically updated.**
You can then edit the values in the file using
```bash
./manage.py edit_credentials
```
Be sure that your `$EDITOR` environment variable is set, as that is what the decrypted file will be opened with.
Finally, to load the values into your environment, you should add the following code to your `wsgi.py` and `manage.py`
files
```python
from env_credentials.credentials import Credentials
Credentials().load()
```
نیازمندی
| مقدار | نام |
|---|---|
| >=2.9,<3.0 | cryptography |
| >=0.13.0,<0.14.0 | python-dotenv |
| >=3.0,<4.0) | django |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6,<4.0 | Python |
نحوه نصب
نصب پکیج whl env-credentials-0.1.0:
pip install env-credentials-0.1.0.whl
نصب پکیج tar.gz env-credentials-0.1.0:
pip install env-credentials-0.1.0.tar.gz