From 7e06ea02a82b2f9e992b3be2b6e2294eec50f227 Mon Sep 17 00:00:00 2001 From: anatoly techtonik Date: Tue, 20 Oct 2015 08:30:25 +0300 Subject: [PATCH] Use modern URL scheme for localhost static --- readthedocs/urls.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/readthedocs/urls.py b/readthedocs/urls.py index 25307457220..7ae9661d212 100644 --- a/readthedocs/urls.py +++ b/readthedocs/urls.py @@ -1,6 +1,7 @@ from django.conf.urls import url, patterns, include from django.contrib import admin from django.conf import settings +from django.conf.urls.static import static from django.views.generic.base import TemplateView from tastypie.api import Api @@ -75,7 +76,4 @@ '', # base view, flake8 complains if it is on the previous line. url('style-catalog/$', TemplateView.as_view(template_name='style_catalog.html')), - url(regex='^%s/(?P.*)$' % settings.MEDIA_URL.strip('/'), - view='django.views.static.serve', - kwargs={'document_root': settings.MEDIA_ROOT}), - ) + ) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)