diff --git a/app/settings.py b/app/settings.py index 9f7fda5..23f6254 100644 --- a/app/settings.py +++ b/app/settings.py @@ -35,17 +35,21 @@ INSTALLED_APPS = [ "django.contrib.sessions", "django.contrib.messages", "django.contrib.staticfiles", + "debug_toolbar", + "template_profiler_panel", "django_htmx", "crispy_forms", "crispy_bulma", "django_tables2", "django_tables2_bulma_template", + ] CRISPY_TEMPLATE_PACK = "bulma" CRISPY_ALLOWED_TEMPLATE_PACKS = ("bulma",) DJANGO_TABLES2_TEMPLATE = "django-tables2/bulma.html" MIDDLEWARE = [ + "debug_toolbar.middleware.DebugToolbarMiddleware", "django.middleware.security.SecurityMiddleware", "django.contrib.sessions.middleware.SessionMiddleware", "django.middleware.common.CommonMiddleware", @@ -139,6 +143,10 @@ REST_FRAMEWORK = { ] } +INTERNAL_IPS = [ + "127.0.0.1", +] + from app.local_settings import * # noqa if PROFILER: # noqa - trust me its there diff --git a/app/urls.py b/app/urls.py index 49552ba..53b0b7c 100644 --- a/app/urls.py +++ b/app/urls.py @@ -73,6 +73,7 @@ from core.views.ui.insights import ( ) urlpatterns = [ + path('__debug__/', include('debug_toolbar.urls')), path("", DrilldownTableView.as_view(), name="home"), path("search/", DrilldownTableView.as_view(), name="search"), path("about/", About.as_view(), name="about"), diff --git a/core/templates/ui/drilldown/table_results_partial.html b/core/templates/ui/drilldown/table_results_partial.html index 7ecfc1a..691ce11 100644 --- a/core/templates/ui/drilldown/table_results_partial.html +++ b/core/templates/ui/drilldown/table_results_partial.html @@ -1,5 +1,4 @@ {% load django_tables2 %} -{% load i18n %} {% load django_tables2_bulma_template %} {% load static %} {% load joinsep %} diff --git a/docker/Dockerfile b/docker/Dockerfile index 29cec43..d099438 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -15,4 +15,4 @@ WORKDIR /code COPY requirements.dev.txt /code/ RUN python -m venv /venv RUN . /venv/bin/activate && pip install -r requirements.dev.txt -CMD . /venv/bin/activate && exec python manage.py runserver 0.0.0.0:8000 \ No newline at end of file +CMD . /venv/bin/activate && exec python manage.py runserver --nothreading 0.0.0.0:8000 \ No newline at end of file diff --git a/docker/prod/requirements.prod.txt b/docker/prod/requirements.prod.txt index 99d1c15..6a1fa48 100644 --- a/docker/prod/requirements.prod.txt +++ b/docker/prod/requirements.prod.txt @@ -15,3 +15,5 @@ siphashc redis sortedcontainers manticoresearch +django-debug-toolbar +django-debug-toolbar-template-profiler diff --git a/docker/requirements.dev.txt b/docker/requirements.dev.txt index 06710d2..cac00a9 100644 --- a/docker/requirements.dev.txt +++ b/docker/requirements.dev.txt @@ -14,3 +14,5 @@ siphashc redis sortedcontainers manticoresearch +django-debug-toolbar +django-debug-toolbar-template-profiler diff --git a/requirements.txt b/requirements.txt index 17a96c2..18b09ab 100644 --- a/requirements.txt +++ b/requirements.txt @@ -15,3 +15,5 @@ siphashc redis sortedcontainers manticoresearch +django-debug-toolbar +django-debug-toolbar-template-profiler