Revert "Revert "add the posibility of specifying a url prefix"" (#206)

* Revert "Revert "add the posibility of specifying a url prefix (#143)" (#205)"

* mysql client
This commit is contained in:
Darren 2022-05-29 13:56:56 -04:00 committed by GitHub
parent 5ec8e0507e
commit 51e9172479
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 3 deletions

View File

@ -51,6 +51,8 @@ MEDIA_ROOT = env("MEDIA_ROOT", ".media")
STATIC_URL = "/static/"
URL_PREFIX = env("URL_PREFIX", "")
ROOT_URLCONF = "dpaste.urls"
WSGI_APPLICATION = "dpaste.wsgi.application"

View File

@ -1,9 +1,12 @@
from django.urls import include, re_path
from django.conf import settings
url_prefix = getattr(settings, "URL_PREFIX", "")
urlpatterns = [
re_path(r"^", include("dpaste.urls.dpaste_api")),
re_path(r"^", include("dpaste.urls.dpaste")),
re_path(r"^i18n/", include("django.conf.urls.i18n")),
re_path(r"^%s" % url_prefix, include("dpaste.urls.dpaste_api")),
re_path(r"^%s" % url_prefix, include("dpaste.urls.dpaste")),
re_path(r"^%si18n/" % url_prefix, include("django.conf.urls.i18n")),
]
# Custom error handlers which load `dpaste/<code>.html` instead of `<code>.html`

View File

@ -31,6 +31,7 @@ install_requires =
# Essential packages
django>=3.2
pygments>=2.11
mysqlclient>=2.1.0
django-staticinline>=1.0
django-csp>=3.6
dj_database_url>=0.5.0