fix: remove obsolete static file handler

master
Xiretza 3 years ago committed by Tom Hacohen
parent e635e081c7
commit 13a137a128

@ -2,7 +2,7 @@ import os
from django.conf import settings from django.conf import settings
from django.contrib import admin 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.generic import TemplateView
from django.views.static import serve from django.views.static import serve
from django.contrib.staticfiles import finders from django.contrib.staticfiles import finders
@ -11,14 +11,3 @@ urlpatterns = [
path("admin/", admin.site.urls), path("admin/", admin.site.urls),
path("", TemplateView.as_view(template_name="success.html")), 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<path>.*)$", serve_static)]

Loading…
Cancel
Save