Django Secret Key
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
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
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
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.
import os
from secret_key import secret_key
# ...
SECRET_KEY = secret_key.generate()
But, this method not recommanded.
Metadata
Release files for DjangoSecretKey 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| DjangoSecretKey-0.1.0.tar.gz | 2.8 kB | Without provenance | Details for DjangoSecretKey-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| DjangoSecretKey-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for DjangoSecretKey-0.1.0-py3-none-any.whl |
Total release size: 6.7 kB
Release files / DjangoSecretKey-0.1.0.tar.gz
| Download URL | DjangoSecretKey-0.1.0.tar.gz |
|---|---|
| Size | 2.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
17aae43b852cd04ff92ec247ba908e0d6862b9b054a0fc3aeeaf492dcf2cf4d3
|
|
BLAKE2b-256 checksum How to use checksums |
4116ab8239b86b22f84ce2cefddc86637dec4bba317af20eda77454e7aca471a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3
|
Release files / DjangoSecretKey-0.1.0-py3-none-any.whl
| Download URL | DjangoSecretKey-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e1570b1a2395194041f30a35f2dcafc0ae21e0b47ef9130d7900fc0de554b66a
|
|
BLAKE2b-256 checksum How to use checksums |
1522018d196d4a41fb63b04d14c4c918b84a7bc636dc5f9423f052454a007894
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3
|
Security for DjangoSecretKey 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.