From a4af0c89f541548a9f480650d66c5a87539037dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Delobelle?= Date: Sat, 16 Sep 2017 02:41:30 +0200 Subject: [PATCH] Update example site... ... to reflect last changes. django-debug-toolbar is now installed. --- example/app/templates/app/home.html | 4 +++- example/requirements.txt | 1 + example/settings.py | 9 ++++++++- example/urls.py | 4 ++++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/example/app/templates/app/home.html b/example/app/templates/app/home.html index 910e176..bbea9b6 100644 --- a/example/app/templates/app/home.html +++ b/example/app/templates/app/home.html @@ -50,7 +50,6 @@ Non connecté

Les pages suivantes nécessitent d'être connecté pour y accéder.

+ + + diff --git a/example/requirements.txt b/example/requirements.txt index c642fd0..ae78796 100644 --- a/example/requirements.txt +++ b/example/requirements.txt @@ -1 +1,2 @@ -e ../ +django-debug-toolbar diff --git a/example/settings.py b/example/settings.py index 5c04e80..dd0c34d 100644 --- a/example/settings.py +++ b/example/settings.py @@ -22,6 +22,7 @@ INSTALLED_APPS = [ 'django.contrib.sites', 'django.contrib.staticfiles', + 'debug_toolbar', 'widget_tweaks', # This one must be before 'allauth' to replace its templates. @@ -43,6 +44,7 @@ INSTALLED_APPS = [ _MIDDLEWARES = [ 'django.middleware.common.CommonMiddleware', + 'debug_toolbar.middleware.DebugToolbarMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', @@ -109,10 +111,15 @@ USE_TZ = True STATIC_URL = '/static/' +DEBUG_TOOLBAR_CONFIG = { + 'SHOW_TOOLBAR_CALLBACK': lambda r: True, +} + AUTH_USER_MODEL = 'app.User' LOGIN_URL = '/account/login/' -LOGIN_REDIRECT_URL = '/account/settings/' +LOGIN_REDIRECT_URL = 'user-view' +ACCOUNT_LOGOUT_REDIRECT_URL = 'view' SOCIALACCOUNT_QUERY_EMAIL = True diff --git a/example/urls.py b/example/urls.py index 98df25d..59d2f12 100644 --- a/example/urls.py +++ b/example/urls.py @@ -3,6 +3,8 @@ 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 = [ @@ -28,3 +30,5 @@ urlpatterns = [ # (Redirect from /) url(r'^$', RedirectView.as_view(url='/view/')), ] + +urlpatterns += [url(r'^__debug__/', include(debug_toolbar.urls))]