Self hosted FLOSS fitness/workout, nutrition and weight tracker
Set the site URL to the value set in SITE_URL in the configuration file
Roland Geiderf2bd90eaa3cf
diff --git a/extras/docker/development/entrypoint.sh b/extras/docker/development/entrypoint.shindex c64dcb5d8..7cb54d63e 100644--- a/extras/docker/development/entrypoint.sh+++ b/extras/docker/development/entrypoint.sh@@ -59,6 +59,9 @@ thenpython3 manage.py download-exercise-imagesfi+# Set the site URL+python3 manage.py set-site-url+# Run the serverif [[ "$WGER_USE_GUNICORN" == "True" ]];thendiff --git a/wger/core/management/commands/set-site-url.py b/wger/core/management/commands/set-site-url.pynew file mode 100644index 000000000..a584d9e51--- /dev/null+++ b/wger/core/management/commands/set-site-url.py@@ -0,0 +1,21 @@+# Django+from django.contrib.sites.models import Site+from django.conf import settings+from django.core.management.base import BaseCommand++"""+Sets the site URL+"""+++class Command(BaseCommand):++ help = 'Sets the site URL from settings.SITE_URL, this is used e.g. for password reset emails'++ def handle(self, *args, **options):++ site = Site.objects.get_current()+ site.domain = settings.SITE_URL+ site.name = settings.SITE_URL+ site.save()+ self.stdout.write(self.style.SUCCESS(f"Set site URL to {settings.SITE_URL}"))