diff --git a/aleksis/core/management/commands/convert_urls_to_routes.py b/aleksis/core/management/commands/convert_urls_to_routes.py index eb13da979771eddd64bfdbb74a4fa778b83a7822..e484988ef8bb2c37014daa91d18ab4ee41864255 100644 --- a/aleksis/core/management/commands/convert_urls_to_routes.py +++ b/aleksis/core/management/commands/convert_urls_to_routes.py @@ -60,7 +60,9 @@ class Command(BaseCommand): # Start building route route = "{\n" route += f' path: "{url_pattern}",\n' - route += ' component: () => import("aleksis.core/components/LegacyBaseTemplate.vue"),\n' + route += ( + ' component: () => import("aleksis.core/components/LegacyBaseTemplate.vue"),\n' + ) route += f' name: "{route_name}",\n' if menu: diff --git a/aleksis/core/settings.py b/aleksis/core/settings.py index 8b66579dd223cc00e4ac2dc86fb90052f4e21aa9..44d440510a4e21af4006d26a2763d6f86d4ae3d7 100644 --- a/aleksis/core/settings.py +++ b/aleksis/core/settings.py @@ -64,13 +64,14 @@ UWSGI_SERVE_STATIC = True UWSGI_SERVE_MEDIA = False DEV_SERVER_PORT = 8000 -DJANGO_VITE_DEV_SERVER_PORT = DEV_SERVER_PORT+1 +DJANGO_VITE_DEV_SERVER_PORT = DEV_SERVER_PORT + 1 ALLOWED_HOSTS = _settings.get("http.allowed_hosts", [getfqdn(), "localhost", "127.0.0.1", "[::1]"]) BASE_URL = _settings.get( "http.base_url", f"http://localhost:{DEV_SERVER_PORT}" if DEBUG else f"//{ALLOWED_HOSTS[0]}" ) + def generate_trusted_origins(): origins = [] origins += [f"http://{host}" for host in ALLOWED_HOSTS] @@ -79,6 +80,8 @@ def generate_trusted_origins(): origins += [f"http://{host}:{DEV_SERVER_PORT}" for host in ALLOWED_HOSTS] origins += [f"http://{host}:{DJANGO_VITE_DEV_SERVER_PORT}" for host in ALLOWED_HOSTS] return origins + + CSRF_TRUSTED_ORIGINS = _settings.get("http.trusted_origins", generate_trusted_origins()) # Application definition