diff --git a/.env.test b/.env.test index e987881..29627dd 100644 --- a/.env.test +++ b/.env.test @@ -1,4 +1,4 @@ DATABASE_URL=psql://teilchensammler:teilchensammler@localhost:5432/teilchensammler_test DEBUG=On SECRET_KEY=django-insecure-x=%#_wxu0h=d*m#seui9+mjh3vu7of8+4+gpwj@556.un0r1%. -DEV=On +DEV=Off diff --git a/config/settings.py b/config/settings.py index 1ba5c58..ca24b62 100644 --- a/config/settings.py +++ b/config/settings.py @@ -47,6 +47,7 @@ if env("DEV") is True: INSTALLED_APPS.extend( [ "django_extensions", + "debug_toolbar", ] ) SHELL_PLUS = "ipython" @@ -60,6 +61,11 @@ MIDDLEWARE = [ "django.contrib.messages.middleware.MessageMiddleware", "django.middleware.clickjacking.XFrameOptionsMiddleware", ] +if env("DEV") is True: + MIDDLEWARE.append("debug_toolbar.middleware.DebugToolbarMiddleware") + INTERNAL_IPS = [ + "127.0.0.1", + ] ROOT_URLCONF = "config.urls" diff --git a/config/urls.py b/config/urls.py index a1445ed..894cad6 100644 --- a/config/urls.py +++ b/config/urls.py @@ -17,8 +17,9 @@ Including another URLconf from django.contrib import admin from django.urls import include, path +from debug_toolbar.toolbar import debug_toolbar_urls urlpatterns = [ path("collector/", include("collector.urls")), path("admin/", admin.site.urls), -] +] + debug_toolbar_urls() diff --git a/requirements/dev.in b/requirements/dev.in index f94c67b..d01f253 100644 --- a/requirements/dev.in +++ b/requirements/dev.in @@ -1,5 +1,6 @@ -r test.in +django-debug-toolbar django-extensions django-stubs ipython diff --git a/requirements/dev.txt b/requirements/dev.txt index 3ce78a7..ed50f21 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,4 +1,4 @@ -# SHA1:39149ea105722c1b0bd2fea274b35b595e3eab9a +# SHA1:0f71cd64a0fccc28bc97abcbc3c140da1b54b8e4 # # This file is autogenerated by pip-compile-multi # To update, run: @@ -10,6 +10,7 @@ asttokens==3.0.0 build==1.2.2.post1 click==8.1.8 decorator==5.2.1 +django-debug-toolbar==5.0.1 django-extensions==3.2.3 django-stubs==5.1.3 django-stubs-ext==5.1.3