From: Guillaume Pellerin Date: Mon, 16 Jan 2023 15:26:59 +0000 (+0100) Subject: add Site update command X-Git-Tag: 2.8.0~34 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=cef446b96a32bd750beb27b6e94f107899a3c978;p=teleforma.git add Site update command --- diff --git a/teleforma/management/commands/teleforma-update-site.py b/teleforma/management/commands/teleforma-update-site.py new file mode 100644 index 00000000..01e06e93 --- /dev/null +++ b/teleforma/management/commands/teleforma-update-site.py @@ -0,0 +1,15 @@ +from django.core.management.base import BaseCommand +from django.contrib.sites.models import Site +from django.conf import settings + + +class Command(BaseCommand): + help = "Change Site domain to another" + + def handle(self, *args, **options): + to_domain = args[-1] + from_domain = args[-2] + + site = Site.objects.get(domain=from_domain) + site.domain = to_domain + site.save()