Files
backend/apps/shared/management/commands/secret_key.py
A'zamov Samandar 0229a0595c
Some checks failed
Deploy Django Application to Server / deploy (push) Failing after 19s
Telegram Notifications / Telegram Gate (push) Failing after 5s
gealogiuya
2026-02-27 14:56:23 +05:00

22 lines
669 B
Python

from colorama import Fore, Style
from django.core.management import utils
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = "Generates a new Django secret key"
def handle(self, *args, **options):
print(
Fore.LIGHTCYAN_EX
+ "<======================================================>"
)
print(
"<=" + Style.RESET_ALL,
Fore.LIGHTMAGENTA_EX + utils.get_random_secret_key() + Style.RESET_ALL,
Fore.LIGHTCYAN_EX + "=>",
)
print(
"<======================================================>" + Style.RESET_ALL
)