2020-06-16 12:00:24 +02:00
|
|
|
from django.urls import path, include
|
2017-09-21 10:35:29 +02:00
|
|
|
from django.contrib import admin
|
2017-10-14 16:22:23 +02:00
|
|
|
from django.contrib.auth.decorators import login_required
|
|
|
|
import django.contrib.auth.views as dj_auth_views
|
2017-09-21 10:35:29 +02:00
|
|
|
|
2017-09-21 19:01:47 +02:00
|
|
|
import mainsite.urls
|
2017-10-14 17:15:51 +02:00
|
|
|
import bocal_auth.views as auth_views
|
2017-10-14 19:36:13 +02:00
|
|
|
from bocal_auth.rhosts import forceReevalRhosts
|
2017-09-23 18:48:29 +02:00
|
|
|
import markdownx.urls
|
2017-09-24 18:21:16 +02:00
|
|
|
import api.urls
|
2017-09-21 19:01:47 +02:00
|
|
|
|
2017-10-14 16:22:23 +02:00
|
|
|
import django_cas_ng.views
|
|
|
|
|
|
|
|
|
|
|
|
# Force the user to login through the custom login page
|
2017-10-14 19:36:13 +02:00
|
|
|
admin.site.login = login_required(forceReevalRhosts(admin.site.login))
|
2017-10-14 16:22:23 +02:00
|
|
|
|
|
|
|
cas_patterns = [
|
2020-06-16 12:00:24 +02:00
|
|
|
path("login/", django_cas_ng.views.LoginView.as_view(), name="cas_ng_login"),
|
|
|
|
path("logout/", django_cas_ng.views.LogoutView.as_view(), name="cas_ng_logout"),
|
|
|
|
path(
|
|
|
|
"callback/",
|
|
|
|
django_cas_ng.views.CallbackView.as_view(),
|
|
|
|
name="cas_ng_proxy_callback",
|
|
|
|
),
|
2017-10-14 16:22:23 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
accounts_patterns = [
|
2020-06-16 12:00:24 +02:00
|
|
|
path("cas/", include(cas_patterns)),
|
|
|
|
path("login/", auth_views.login, name="login"),
|
|
|
|
path("logout/", auth_views.logout, name="logout"),
|
|
|
|
path("password_login/", dj_auth_views.LoginView.as_view(), name="password_login"),
|
2017-10-14 16:22:23 +02:00
|
|
|
]
|
|
|
|
|
2017-09-21 10:35:29 +02:00
|
|
|
urlpatterns = [
|
2020-06-16 12:00:24 +02:00
|
|
|
path("admin/", admin.site.urls),
|
|
|
|
path("markdownx/", include(markdownx.urls)),
|
|
|
|
path("api/", include(api.urls)),
|
|
|
|
path("accounts/", include(accounts_patterns)),
|
|
|
|
path("", include(mainsite.urls)),
|
2017-09-21 10:35:29 +02:00
|
|
|
]
|