-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathurls.py
51 lines (37 loc) · 1.49 KB
/
urls.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# -*- coding: utf-8 -*-
import os
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth import views as django_auth
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from wirecloud.commons import authentication as wc_auth
from wirecloud.fiware import views as wc_fiware
from wirecloud.keycloak import views as wc_keycloak
import wirecloud.platform.urls
admin.autodiscover()
login_method = django_auth.login
if settings.IDM_AUTH == 'fiware':
login_method = wc_fiware.login
if settings.IDM_AUTH == 'keycloak':
login_method = wc_keycloak.login
urlpatterns = (
# Catalogue
url(r'^catalogue/', include('wirecloud.catalogue.urls')),
# Proxy
url(r'^cdp/', include('wirecloud.proxy.urls')),
# Login/logout
url(r'^login/?$', login_method, name="login"),
url(r'^logout/?$', wc_auth.logout, name="logout"),
url(r'^admin/logout/?$', wc_auth.logout),
# Admin interface
url(os.environ.get("ADMIN_URL_PATH", r'^admin/'), include(admin.site.urls)),
)
if settings.IDM_AUTH is not None:
urlpatterns += (url('', include('social_django.urls', namespace='social')),)
urlpatterns += wirecloud.platform.urls.urlpatterns
urlpatterns += tuple(staticfiles_urlpatterns())
handler400 = "wirecloud.commons.views.bad_request"
handler403 = "wirecloud.commons.views.permission_denied"
handler404 = "wirecloud.commons.views.page_not_found"
handler500 = "wirecloud.commons.views.server_error"