From 48cb351263ff788332727c7ba09969b47b6933f9 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Thu, 30 Jan 2025 10:20:53 +0100 Subject: [PATCH] add key for open service --- idhub/management/commands/open_service.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 idhub/management/commands/open_service.py diff --git a/idhub/management/commands/open_service.py b/idhub/management/commands/open_service.py new file mode 100644 index 0000000..1cc04d6 --- /dev/null +++ b/idhub/management/commands/open_service.py @@ -0,0 +1,15 @@ +from django.core.management.base import BaseCommand +from django.core.management import call_command +from django.core.cache import cache + + +class Command(BaseCommand): + help = "Command for open de service" + + def add_arguments(self, parser): + parser.add_argument('key', nargs='?', default='', type=str, help='key') + + def handle(self, *args, **kwargs): + PASSWORD = kwargs["key"] + cache.set("KEY_DIDS", PASSWORD, None) + call_command('runserver')