Generating a random secret key for Django project January 10, 2020 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. Read more