From 66c3be18fc863f2008a927628a4af4296460a950 Mon Sep 17 00:00:00 2001 From: Edoardo Abati <29585319+EdAbati@users.noreply.github.com> Date: Sat, 7 Nov 2026 08:35:22 +0100 Subject: [PATCH] Allow custom-admin host in Astro dev server In local dev, /admin/login/ fails with a 500 because Django fetches its admin base template from the Astro dev server at http://custom-admin:3002 and Vite answers 403 for that hostname. The check came in with the Astro ^5.0.5 to ^7.4.4 upgrade in #4841, which moved Vite from 6.0.3 to 8.3.5. Django connects using the Docker service name, so that hostname has to be allowed. Only local dev is affected, because astro_proxy returns 404 when DEBUG is off. --- backend/custom_admin/astro.config.mjs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/custom_admin/astro.config.mjs b/backend/custom_admin/astro.config.mjs index b37be356e9..a93e8a0bbc 100644 --- a/backend/custom_admin/astro.config.mjs +++ b/backend/custom_admin/astro.config.mjs @@ -2,6 +2,9 @@ import react from "@astrojs/react"; import { defineConfig } from "astro/config"; export default defineConfig({ + server: { + allowedHosts: ["custom-admin"], + }, vite: { logLevel: "info", server: {