From: Guillaume Pellerin Date: Mon, 16 Jan 2023 15:26:59 +0000 (+0100) Subject: add Site update command X-Git-Tag: 2.8.1-pro~49^2 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=6e4fd19297adce191b77c3346281641ae27e8261;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()