Skip to main content

Generating a random secret key for Django project

Go to python shell and run these commands:

from django.core.management.utils import get_random_secret_key

get_random_secret_key()

It will generate a new secret key, which can be pasted in settings file.

Comments