You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.9 KiB
44 lines
1.9 KiB
"""VRE URL Configuration |
|
|
|
The `urlpatterns` list routes URLs to views. For more information please see: |
|
https://docs.djangoproject.com/en/dev/topics/http/urls/ |
|
Examples: |
|
Function views |
|
1. Add an import: from my_app import views |
|
2. Add a URL to urlpatterns: path('', views.home, name='home') |
|
Class-based views |
|
1. Add an import: from other_app.views import Home |
|
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') |
|
Including another URLconf |
|
1. Import the include() function: from django.urls import include, path |
|
2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) |
|
""" |
|
from django.conf import settings |
|
from django.conf.urls.static import static |
|
from django.contrib import admin |
|
from django.urls import path, include |
|
from django.urls.base import reverse_lazy |
|
from django.views.generic.base import RedirectView |
|
|
|
from .views import test_login_page |
|
|
|
urlpatterns = [ |
|
path('api/', include('apps.api.urls')), |
|
path('admin/', admin.site.urls), |
|
|
|
path('oidc/', include('mozilla_django_oidc.urls')), |
|
|
|
# Redirect alias so we have an easy to remember url for login. |
|
path('auth/login/', RedirectView.as_view(url=reverse_lazy('oidc_authentication_init')), name='api-login-surfconext'), |
|
# Redirect alias so we have an easy to remember url for logout does not work. It needs to be an post action |
|
# TODO: Make this a bit easier? How do we do the logout? |
|
#path('auth/logout/', RedirectView.as_view(url=reverse_lazy('oidc_logout')), name='api-logout-surfconext'), |
|
# For testing only.... should be loaded only when debug is true |
|
path('auth/login/test/', test_login_page, name='test-login-surfconext') |
|
|
|
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) |
|
|
|
if settings.DEBUG: |
|
import debug_toolbar |
|
# urlpatterns.append(path('auth/login/test/', test_login_page, name='test-login-surfconext')) |
|
urlpatterns.append(path('__debug__/', include(debug_toolbar.urls)))
|
|
|