Skip to content

Commit

Permalink
fix: include browserReload when in DEBUG mode
Browse files Browse the repository at this point in the history
  • Loading branch information
kritzl committed Jul 11, 2024
1 parent bff7240 commit 93cb8fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/vinywaji/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@
"vinywaji.metrics",
"macros",
"tailwind",
"django_browser_reload" if DEBUG else None,
]

if DEBUG:
INSTALLED_APPS.append("django_browser_reload")

MIDDLEWARE = [
"whitenoise.middleware.WhiteNoiseMiddleware",
"django.middleware.security.SecurityMiddleware",
Expand All @@ -72,9 +74,11 @@
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
"simple_openid_connect.integrations.django.middleware.TokenVerificationMiddleware",
"django_browser_reload.middleware.BrowserReloadMiddleware" if DEBUG else None,
]

if DEBUG:
MIDDLEWARE.append("django_browser_reload.middleware.BrowserReloadMiddleware")

ROOT_URLCONF = "vinywaji.urls"

TEMPLATES = [
Expand Down
3 changes: 2 additions & 1 deletion src/vinywaji/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
path("api/", include("vinywaji.api.urls")),
path("metrics/", include("vinywaji.metrics.urls")),
path("", include("vinywaji.gui.urls")),
path("__reload__/", include("django_browser_reload.urls")) if settings.DEBUG else None,
]
if settings.DEBUG:
urlpatterns.append(path("__reload__/", include("django_browser_reload.urls")))

0 comments on commit 93cb8fc

Please sign in to comment.