Merge pull request #4095 from jsaalfeld/fix_trailing_slash
fixing the wsgi server by removing trailing slashes on static files
This commit is contained in:
commit
44846da4cd
@ -1,6 +1,5 @@
|
|||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.conf.urls import include, url
|
from django.conf.urls import include, url
|
||||||
from django.views.generic import RedirectView
|
|
||||||
|
|
||||||
from openslides.mediafiles.views import protected_serve
|
from openslides.mediafiles.views import protected_serve
|
||||||
from openslides.utils.rest_api import router
|
from openslides.utils.rest_api import router
|
||||||
@ -15,9 +14,6 @@ urlpatterns = [
|
|||||||
protected_serve,
|
protected_serve,
|
||||||
{"document_root": settings.MEDIA_ROOT},
|
{"document_root": settings.MEDIA_ROOT},
|
||||||
),
|
),
|
||||||
# When a url without a leading slash is requested, redirect to the url with
|
|
||||||
# the slash. This line has to be after static and media files.
|
|
||||||
url(r"^(?P<url>.*[^/])$", RedirectView.as_view(url="/%(url)s/", permanent=True)),
|
|
||||||
# URLs for the rest system
|
# URLs for the rest system
|
||||||
url(r"^rest/", include(router.urls)),
|
url(r"^rest/", include(router.urls)),
|
||||||
# Other urls defined by modules and plugins
|
# Other urls defined by modules and plugins
|
||||||
|
Loading…
Reference in New Issue
Block a user