Files
dbstorage/generate_secret_key.py

18 lines
514 B
Python
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env python3
"""
Скрипт для генерации Django SECRET_KEY
Использование: python generate_secret_key.py
"""
from django.core.management.utils import get_random_secret_key
if __name__ == "__main__":
secret_key = get_random_secret_key()
print("\nВаш новый SECRET_KEY:")
print("=" * 80)
print(secret_key)
print("=" * 80)
print("\nСкопируйте его в файл .env:")
print(f"SECRET_KEY={secret_key}")
print()