From 0d20b543b0294dcf5ee160419ba780eaa9e3120e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Sat, 7 Jan 2023 21:59:54 +0100 Subject: [PATCH] Do not load the admin interface in prod --- Dockerfile | 2 +- src/web/web/urls.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index ac4c717..9ace161 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ RUN npm install && \ FROM python:3.10.9-alpine -ENV VERSION_NUMBER 0.1.1-7-g1ccfdc3 +ENV VERSION_NUMBER 0.1.1-8-gf7b69f7 ENV PROD 1 RUN apk add \ diff --git a/src/web/web/urls.py b/src/web/web/urls.py index 33d8170..8e43fbf 100644 --- a/src/web/web/urls.py +++ b/src/web/web/urls.py @@ -16,10 +16,13 @@ Including another URLconf from django.contrib import admin from django.urls import include, path from django.views.generic import RedirectView +from django.conf import settings urlpatterns = [ - path("admin/", admin.site.urls), path("", RedirectView.as_view(url="/tracker/list-sessions")), path("tracker/", include("tracker.urls")), ] + +if settings.DEBUG: + urlpatterns.append(path("admin/", admin.site.urls))