Skip to content

Commit

Permalink
add ability to have configurable Django admin path
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvin-muchiri committed Aug 14, 2024
1 parent 7bb0020 commit 41586d2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions onadata/apps/main/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
from onadata.libs.utils.analytics import init_analytics

TESTING = len(sys.argv) > 1 and sys.argv[1] == "test"
ADMIN_URL_PATH = getattr(settings, "ADMIN_URL_PATH", "admin/")

admin.autodiscover()

Expand All @@ -50,8 +51,10 @@
re_path(r"^api/v1$", RedirectView.as_view(url="/api/v1/", permanent=True)),
# django default stuff
re_path(r"^accounts/", include(registration_patterns)),
re_path(r"^admin/", admin.site.urls),
re_path(r"^admin/doc/", include("django.contrib.admindocs.urls")),
re_path(r"^{}/".format(ADMIN_URL_PATH), admin.site.urls),
re_path(
r"^{}/doc/".format(ADMIN_URL_PATH), include("django.contrib.admindocs.urls")
),
# oath2_provider
re_path(
r"^o/authorize/$",
Expand Down

0 comments on commit 41586d2

Please sign in to comment.