Skip to main content

Package for secret key generation in Django framework.

Project description

Tests-CI PyPI release

Secret key generator for Django framework

Installation

pip install secret-key-generator

Usage

In your settings.py file:

from secret_key_generator import secret_key_generator

SECRET_KEY = secret_key_generator.generate()

Customize secret key

SECRET_KEY = secret_key_generator.generate(chars=your_chars_to_use_in_secret_key,
                                           file_name=your_filename,
                                           len_of_secret_key=your_length)

With chars variable the library generates secret key.

file_name is used to name a file that is going to contain the secret key.

len_of_secret_key is used to set length of secret key

Defaults

chars: abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)
file_name: .secret.txt
len_of_secret_key: 50

About the library

This library is meant to help you with the generation of secret keys in Django framework. You do not need to generate the secret keys by yourself, and you don't have to worry about keeping the key in a safe place.

How does it work?

The library randomly generates a secret key, saves it into a file, and reads the key from the file. Each time you run a Django project, the library checks if there is a file with the correct secret key. If there is, then the library reads it. If there no such file, then the library generates a new secret key and saves it into a new file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

secret-key-generator-0.0.8.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

secret_key_generator-0.0.8-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file secret-key-generator-0.0.8.tar.gz.

File metadata

  • Download URL: secret-key-generator-0.0.8.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.2

File hashes

Hashes for secret-key-generator-0.0.8.tar.gz
Algorithm Hash digest
SHA256 952be55754af6039365a84baef6309148c86d2d197f37fac52232468b8860e9a
MD5 e4cd3400c3b516f615a769638e18f83b
BLAKE2b-256 bc22a6c301e63cd2ef096bc761c4688468a748eeb3349ea0aaf65e3e5147397e

See more details on using hashes here.

File details

Details for the file secret_key_generator-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: secret_key_generator-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.2

File hashes

Hashes for secret_key_generator-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 de677d5d9274529ad651f5113eb36d0513b548eb1d284aa8a7e20f0be7e58ce7
MD5 05242ad4e0ec21d63a5d12b7e1517543
BLAKE2b-256 7c2f25e625fe2417a9348060014d9754d6f04761f960e4c3f6ebdf56073c5563

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page