django-allauth-ens/example/urls.py
Aurélien Delobelle a4af0c89f5 Update example site...
... to reflect last changes.

django-debug-toolbar is now installed.
2017-09-16 02:41:30 +02:00

34 lines
1.1 KiB
Python

from django.conf.urls import url, include
from django.contrib import admin
from django.contrib.auth.decorators import login_required, permission_required
from django.views.generic import RedirectView
import debug_toolbar
from app import views
urlpatterns = [
# Catch admin login/logout views.
# url(r'^admin/login/', authens_views.CaptureLogin.as_view()),
# url(r'^admin/logout/', authens_views.CaptureLogout.as_view()),
# Admin urls include comes after.
url(r'^admin/', admin.site.urls),
# Base views with different required permissions.
url(r'^view/', views.HomeView.as_view(),
name='view'),
url(r'^user/', login_required()(views.HomeView.as_view()),
name='user-view'),
url(r'^root/', permission_required('foo.perm')(views.HomeView.as_view()),
name='root-view'),
# Authens urls (handle login/logout views).
url(r'^account/', include('allauth_ens.urls')),
# (Redirect from /)
url(r'^$', RedirectView.as_view(url='/view/')),
]
urlpatterns += [url(r'^__debug__/', include(debug_toolbar.urls))]