From 13a137a12840b49a43908959f1dc713e51fc5b96 Mon Sep 17 00:00:00 2001 From: Xiretza Date: Mon, 9 May 2022 16:37:03 +0200 Subject: [PATCH] fix: remove obsolete static file handler --- etebase_server/urls.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/etebase_server/urls.py b/etebase_server/urls.py index 51b5258..574ddf7 100644 --- a/etebase_server/urls.py +++ b/etebase_server/urls.py @@ -2,7 +2,7 @@ import os from django.conf import settings from django.contrib import admin -from django.urls import path, re_path +from django.urls import path from django.views.generic import TemplateView from django.views.static import serve from django.contrib.staticfiles import finders @@ -11,14 +11,3 @@ urlpatterns = [ path("admin/", admin.site.urls), path("", TemplateView.as_view(template_name="success.html")), ] - -if settings.DEBUG: - - def serve_static(request, path): - filename = finders.find(path) - dirname = os.path.dirname(filename) - basename = os.path.basename(filename) - - return serve(request, basename, dirname) - - urlpatterns += [re_path(r"^static/(?P.*)$", serve_static)]