Skip to content

Commit 2b9b195

Browse files
churnikovCopilotj-awada
authored
SS-1357 Add DJANGO_ADMIN_URL_PATH environment variable for the custom admin route (#314)
Signed-off-by: Nikita Churikov <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: Jana Awada <[email protected]>
1 parent 24d85d0 commit 2b9b195

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

studio/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
# SECURITY WARNING: keep the secret key used in production secret!
3131
SECRET_KEY = "django-insecure-t)9$8__a+vfsak+w30xf9ui9p8#rnyqb6p($!6ne8lin%&zf0h"
32+
DJANGO_ADMIN_URL_PATH = os.environ.get("DJANGO_ADMIN_URL_PATH", "admin")
3233

3334
# SECURITY WARNING: don't run with debug turned on in production!
3435

studio/urls.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
from django.conf.urls.static import static
1919
from django.contrib import admin
2020
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
21-
from django.urls import include, path, re_path
21+
from django.urls import include, path
2222

2323
from . import views
2424

2525
urlpatterns = (
2626
[
27-
path("admin/", admin.site.urls),
27+
path(settings.DJANGO_ADMIN_URL_PATH.rstrip("/") + "/", admin.site.urls),
2828
path("accounts/", include("django.contrib.auth.urls")),
2929
path("user/profile/", views.profile, name="user-profile"),
3030
path("user/delete-account/", views.delete_account, name="delete_account"),

0 commit comments

Comments
 (0)