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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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