2017-09-21 10:35:29 +02:00
|
|
|
"""bocal URL Configuration
|
|
|
|
|
|
|
|
The `urlpatterns` list routes URLs to views. For more information please see:
|
|
|
|
https://docs.djangoproject.com/en/1.11/topics/http/urls/
|
|
|
|
Examples:
|
|
|
|
Function views
|
|
|
|
1. Add an import: from my_app import views
|
|
|
|
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
|
|
|
|
Class-based views
|
|
|
|
1. Add an import: from other_app.views import Home
|
|
|
|
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
|
|
|
|
Including another URLconf
|
|
|
|
1. Import the include() function: from django.conf.urls import url, include
|
|
|
|
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
|
|
|
|
"""
|
2017-09-21 19:01:47 +02:00
|
|
|
from django.conf.urls import url, 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 = [
|
|
|
|
url(r'^login$', django_cas_ng.views.login, name='cas_ng_login'),
|
|
|
|
url(r'^logout$', django_cas_ng.views.logout, name='cas_ng_logout'),
|
|
|
|
url(r'^callback$', django_cas_ng.views.callback,
|
|
|
|
name='cas_ng_proxy_callback'),
|
|
|
|
]
|
|
|
|
|
|
|
|
accounts_patterns = [
|
|
|
|
url(r'^cas/', include(cas_patterns)),
|
|
|
|
url(r'^login$', auth_views.login, name='login'),
|
|
|
|
url(r'^logout$', auth_views.logout, name='logout'),
|
|
|
|
url(r'^password_login$', dj_auth_views.LoginView.as_view(),
|
|
|
|
name='password_login'),
|
|
|
|
]
|
|
|
|
|
2017-09-21 10:35:29 +02:00
|
|
|
urlpatterns = [
|
|
|
|
url(r'^admin/', admin.site.urls),
|
2017-09-23 18:48:29 +02:00
|
|
|
url(r'^markdownx/', include(markdownx.urls)),
|
2017-09-24 18:21:16 +02:00
|
|
|
url(r'^api/', include(api.urls)),
|
2017-10-14 16:22:23 +02:00
|
|
|
url(r'^accounts/', include(accounts_patterns)),
|
2017-09-24 18:21:16 +02:00
|
|
|
url(r'^', include(mainsite.urls)),
|
2017-09-21 10:35:29 +02:00
|
|
|
]
|