www-bocal/bocal/urls.py

54 lines
1.8 KiB
Python
Raw Normal View History

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
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
import mainsite.auth_views as auth_views
import markdownx.urls
2017-09-24 18:21:16 +02:00
import api.urls
2017-09-21 19:01:47 +02:00
import django_cas_ng.views
# Force the user to login through the custom login page
admin.site.login = login_required(admin.site.login)
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),
url(r'^markdownx/', include(markdownx.urls)),
2017-09-24 18:21:16 +02:00
url(r'^api/', include(api.urls)),
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
]