DjangoSecretKey-0.1.0
توضیحات
Django SECRET_KEY management
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | DjangoSecretKey-0.1.0 |
| نام | DjangoSecretKey |
| نسخه کتابخانه | 0.1.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Min Choro |
| ایمیل نویسنده | blinglnav@gmail.com |
| آدرس صفحه اصلی | https://github.com/blinglnav/djangosecretkey |
| آدرس اینترنتی | https://pypi.org/project/DjangoSecretKey/ |
| مجوز | MIT |
Django Secret Key
=================
.. image:: https://travis-ci.org/blinglnav/djangosecretkey.svg?branch=master
:target: https://travis-ci.org/blinglnav/djangosecretkey
.. image:: https://coveralls.io/repos/github/blinglnav/djangosecretkey/badge.svg?branch=master
:target: https://coveralls.io/github/blinglnav/djangosecretkey?branch=master
In Django web framework, it has SECRET_KEY variable in settings.py
this variable use to manage credential values like session.
Therefore, SECRET_KEY value have to store outside of settings.py and
use this value to read from file or environment variables.
Install
-------
.. code:: bash
pip instal djangosecretkey
This project has not any dependencies. (For test, needs pytest package)
*You cannot download yet*
Usage
-----
Use file to store secret key
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In settings.py
.. code:: python
import os
from secret_key import secret_key
# ...
SECRET_KEY = secret_key.from_file(os.path.join(BASE_DIR, 'secret_key'))
**If use .from_file() method, you have to secert key file add to .gitignore**
Use env to store secret key
~~~~~~~~~~~~~~~~~~~~~~~~~~~
In settings.py
.. code:: python
import os
from secret_key import secret_key
# ...
SECRET_KEY = secret_key.from_env('env_name')
default env_name is "DJANGO_SECRET_KEY"
Generate secret key manually
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can also generate secret key manually.
.. code:: python
import os
from secret_key import secret_key
# ...
SECRET_KEY = secret_key.generate()
But, this method not recommanded.
نیازمندی
| مقدار | نام |
|---|---|
| - | pytest |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6 | Python |
نحوه نصب
نصب پکیج whl DjangoSecretKey-0.1.0:
pip install DjangoSecretKey-0.1.0.whl
نصب پکیج tar.gz DjangoSecretKey-0.1.0:
pip install DjangoSecretKey-0.1.0.tar.gz