Skip to content

Commit f5b702f

Browse files
authored
Merge pull request #51 from aarranz/feature/allow-to-switch-admin-path
Allow to configure administration path
2 parents aa09e33 + 2c74c8b commit f5b702f

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

1.3/urls.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# -*- coding: utf-8 -*-
22

3+
import os
4+
35
from django.conf import settings
46
from django.conf.urls import include, url
57
from django.contrib import admin
@@ -34,7 +36,7 @@
3436
url(r'^admin/logout/?$', wc_auth.logout),
3537

3638
# Admin interface
37-
url(r'^admin/', include(admin.site.urls)),
39+
url(os.environ.get("ADMIN_URL_PATH", r'^admin/'), include(admin.site.urls)),
3840
)
3941

4042
if settings.IDM_AUTH is not None:

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ The following environment variables are also honored for configuring your WireCl
6868
- `-e SOCIAL_AUTH_KEYCLOAK_KEY=...` (defaults to nothing)
6969
- `-e SOCIAL_AUTH_KEYCLOAK_SECRET=...` (defaults to nothing)
7070
- `-e HTTPS_VERIFY=...` (True, False or path to a certificate bundle, default to
71-
"/etc/ssl/certs/ca-certificates.crt"
71+
"/etc/ssl/certs/ca-certificates.crt")
72+
- `-e ADMIN_URL_PATH=...` (default to "^admin/", regexp for the administration path)
7273

7374
In addition to those environment variables, this docker image also allows you to
7475
configure the following Django settings using environment variables with the

dev/urls.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# -*- coding: utf-8 -*-
22

3+
import os
4+
35
from django.conf import settings
46
from django.conf.urls import include, url
57
from django.contrib import admin
@@ -34,7 +36,7 @@
3436
url(r'^admin/logout/?$', wc_auth.logout),
3537

3638
# Admin interface
37-
url(r'^admin/', admin.site.urls),
39+
url(os.environ.get("ADMIN_URL_PATH", r'^admin/'), admin.site.urls),
3840
)
3941

4042
if settings.IDM_AUTH:

0 commit comments

Comments
 (0)