From 5d461a177ad6b949b462f2f836d7f573060622a9 Mon Sep 17 00:00:00 2001 From: Andrea Lepori Date: Thu, 23 Sep 2021 10:34:23 +0200 Subject: use .count() instead of len(), add debug_toolbar --- manager/settings.py | 7 +++++++ manager/urls.py | 5 +++++ 2 files changed, 12 insertions(+) (limited to 'manager') diff --git a/manager/settings.py b/manager/settings.py index 03942d9..fae2385 100644 --- a/manager/settings.py +++ b/manager/settings.py @@ -69,6 +69,13 @@ MIDDLEWARE = [ 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] +if DEBUG: + INSTALLED_APPS.append('debug_toolbar') + MIDDLEWARE.append('debug_toolbar.middleware.DebugToolbarMiddleware') + INTERNAL_IPS = [ + '127.0.0.1', + ] + ROOT_URLCONF = 'manager.urls' TEMPLATES = [ diff --git a/manager/urls.py b/manager/urls.py index a2c0ebf..f3b8008 100644 --- a/manager/urls.py +++ b/manager/urls.py @@ -15,6 +15,7 @@ Including another URLconf """ from django.contrib import admin from django.urls import path, include +from django.conf import settings urlpatterns = [ path('', include('client.urls')), @@ -23,3 +24,7 @@ urlpatterns = [ path('accounts/', include('django.contrib.auth.urls')), path('admin/', admin.site.urls), ] + +if settings.DEBUG: + import debug_toolbar + urlpatterns.append(path('__debug__/', include(debug_toolbar.urls))) \ No newline at end of file -- cgit v1.2.1