Commit 0cdb48d9 authored by Samuel GAIST's avatar Samuel GAIST

[urls] URL_PREFIX shall not contain a fully qualified URL therefore no need to parse it

parent 9fd1fd56
Pipeline #43089 passed with stage
in 15 minutes and 28 seconds
......@@ -25,7 +25,6 @@
# #
###############################################################################
from urllib.parse import urlparse
from django.conf import settings
from django.conf.urls import include
......@@ -108,10 +107,9 @@ unprefixed_patterns += [
# Process an eventual prefix in the URLs
parsed_url = urlparse(settings.URL_PREFIX)
if (parsed_url.path != "") and (parsed_url.path != "/"):
if settings.URL_PREFIX not in ["", "/"]:
urlpatterns = [
url(r"^%s/" % parsed_url.path[1:], include(unprefixed_patterns)),
url(r"^%s/" % settings.URL_PREFIX[1:], include(unprefixed_patterns)),
]
else:
urlpatterns = unprefixed_patterns
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment