From ad4f61e533454fdc09ded31994290a31a63a8e30 Mon Sep 17 00:00:00 2001 From: "Y.D.X" <73375426+YDX-2147483647@users.noreply.github.com> Date: Fri, 11 Aug 2023 12:19:05 +0800 Subject: [PATCH] fix: No django_browser_reload in deployment Fixes #34 --- contest/contest/urls.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/contest/contest/urls.py b/contest/contest/urls.py index e6cf952..51fcbc7 100644 --- a/contest/contest/urls.py +++ b/contest/contest/urls.py @@ -20,10 +20,18 @@ from django.urls import include, path from django_cas_ng import views as cas_views +from .settings import DEBUG + urlpatterns = [ path("", include("quiz.urls")), path("admin/", admin.site.urls), path("accounts/login/", cas_views.LoginView.as_view(), name="login"), path("accounts/logout/", cas_views.LogoutView.as_view(), name="logout"), - path("__reload__/", include("django_browser_reload.urls")), ] + +if DEBUG: + urlpatterns.extend( + [ + path("__reload__/", include("django_browser_reload.urls")), + ] + )