name="unsubscribe"), path("subscribe/", weblate.accounts.views.subscribe, name="subscribe"), path("watch/<name:project>/", weblate.accounts.views.watch, name="watch"), path("unwatch/<name:project>/", weblate.accounts.views.unwatch, name="unwatch"), path( "mute/<name:project>/<name:component>/", weblate.accounts.views.mute_component, name="mute", ), path("mute/<name:project>/", weblate.accounts.views.mute_project, name="mute"), path("remove/", weblate.accounts.views.user_remove, name="remove"), path("confirm/", weblate.accounts.views.confirm, name="confirm"), path("login/", weblate.accounts.views.WeblateLoginView.as_view(), name="login"), path("register/", weblate.accounts.views.register, name="register"), path("email/", weblate.accounts.views.email_login, name="email_login"), path("", include((social_urls, "social_auth"), namespace="social")), ] if "simple_sso.sso_server" in settings.INSTALLED_APPS: # pylint: disable=wrong-import-position from simple_sso.sso_server.server import Server server = Server() urlpatterns.append(path("sso/", include(server.get_urls())))
# -*- coding: utf-8 -*- from django.conf import settings from django.conf.urls import patterns, url, include from django.http import HttpResponse from simple_sso.sso_client.client import Client from simple_sso.sso_server.server import Server test_server = Server() test_client = Client(settings.SSO_SERVER, settings.SSO_PUBLIC_KEY, settings.SSO_PRIVATE_KEY) urlpatterns = patterns('', url(r'^server/', include(test_server.get_urls())), url(r'^client/', include(test_client.get_urls())), url(r'^login/$', 'django.contrib.auth.views.login', {'template_name': 'admin/login.html'}), url('^$', lambda request: HttpResponse('home'), name='root') )
__author__ = 'ahmetdal' from simple_sso.sso_server.server import Server sso_server = Server()
weblate.accounts.views.unwatch, name='unwatch' ), url( r'^mute/(?P<project>[^/]+)/(?P<component>[^/]+)/$', weblate.accounts.views.mute_component, name='mute' ), url( r'^mute/(?P<project>[^/]+)/$', weblate.accounts.views.mute_project, name='mute' ), url(r'^remove/$', weblate.accounts.views.user_remove, name='remove'), url(r'^confirm/$', weblate.accounts.views.confirm, name='confirm'), url( r'^login/$', weblate.accounts.views.WeblateLoginView.as_view(), name='login' ), url(r'^register/$', weblate.accounts.views.register, name='register'), url(r'^email/$', weblate.accounts.views.email_login, name='email_login'), url(r'', include((social_urls, 'social_auth'), namespace='social')), ] if 'simple_sso.sso_server' in settings.INSTALLED_APPS: # pylint: disable=wrong-import-position from simple_sso.sso_server.server import Server server = Server() urlpatterns.append(url(r'^sso/', include(server.get_urls())))
https://docs.djangoproject.com/en/3.1/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.contrib import admin from django.urls import path, include from django.views.generic import TemplateView from simple_sso.sso_server.server import Server test_server = Server() urlpatterns = [ path('server/', include(test_server.get_urls())), path('', TemplateView.as_view(template_name='users/registeraion/home.html'), name='home'), path('admin/', admin.site.urls), path('accounts/', include('users.urls')), path('accounts/', include('django.contrib.auth.urls')), ]
from django.conf import settings from django.contrib import admin from django.contrib.auth.views import LoginView from django.http import HttpResponse from django.urls import re_path, include from simple_sso.sso_client.client import Client from simple_sso.sso_server.server import Server test_server = Server() test_client = Client(settings.SSO_SERVER, settings.SSO_PUBLIC_KEY, settings.SSO_PRIVATE_KEY) urlpatterns = [ re_path(r'^admin/', admin.site.urls), re_path(r'^server/', include(test_server.get_urls())), re_path(r'^client/', include(test_client.get_urls())), re_path(r'^login/$', LoginView.as_view(template_name='admin/login.html'), name="login"), re_path('^$', lambda request: HttpResponse('home'), name='root') ]
if 'geonode.geoserver' in settings.INSTALLED_APPS: # GeoServer Helper Views urlpatterns += patterns('', # Upload views (r'^upload/', include('geonode.upload.urls')), (r'^gs/', include('geonode.geoserver.urls')), ) if 'notification' in settings.INSTALLED_APPS: urlpatterns += patterns('', (r'^notifications/', include('notification.urls')), ) if 'simple_sso.sso_server' in settings.INSTALLED_APPS: from simple_sso.sso_server.server import Server server = Server() urlpatterns += server.get_urls() # Set up proxy urlpatterns += geonode.proxy.urls.urlpatterns # Serve static files urlpatterns += staticfiles_urlpatterns() urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) handler403 = 'geonode.views.err403' # Featured Maps Pattens urlpatterns += patterns('', (r'^featured/(?P<site>[A-Za-z0-9_\-]+)/$', 'geonode.maps.views.featured_map'), (r'^featured/(?P<site>[A-Za-z0-9_\-]+)/info$', 'geonode.maps.views.featured_map_info'), )
# Django specific from django.conf import settings from django.conf.urls import patterns, include, url from django.contrib import admin from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse, reverse_lazy from django.http import HttpResponse # App specific from simple_sso.sso_server.server import Server admin.autodiscover() admin.site.login = login_required(admin.site.login, login_url=reverse_lazy(settings.LOGIN_URL)) authserver = Server() urlpatterns = patterns('', url(r'^authserver/', include(authserver.get_urls())), url(r'^admin/', include(admin.site.urls)), url(r'^login/$', 'django.contrib.auth.views.login', { 'template_name': 'login.html' }, name='login'), ) # App mock urlpatterns += patterns('', url('^$', lambda request: HttpResponse('Welcome at the <strong>server</strong> visit <a href="/secret/">secret</a> or <a href="/admin/">admin</a>.')), url('^secret/$', login_required( lambda request: HttpResponse('Secret at the server'), login_url=reverse('login') ), name='root'),
name='logout' ), url(r'^profile/', weblate.accounts.views.user_profile, name='profile'), url( r'^watch/(?P<project>[^/]+)/', weblate.accounts.views.watch, name='watch' ), url( r'^unwatch/(?P<project>[^/]+)/', weblate.accounts.views.unwatch, name='unwatch' ), url(r'^remove/', weblate.accounts.views.user_remove, name='remove'), url(r'^confirm/', weblate.accounts.views.confirm, name='confirm'), url( r'^login/$', weblate.accounts.views.WeblateLoginView.as_view(), name='login' ), url(r'^register/$', weblate.accounts.views.register, name='register'), url(r'^email/$', weblate.accounts.views.email_login, name='email_login'), url(r'', include((social_urls, 'social_auth'), namespace='social')), ] if 'simple_sso.sso_server' in settings.INSTALLED_APPS: # pylint: disable=wrong-import-position from simple_sso.sso_server.server import Server server = Server() urlpatterns.append(url(r'^sso/', include(server.get_urls())))