Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ STRIPE_SECRET_API_KEY=

Adding the secret keys after the `=` symbol.

## Enabling Django Debug Toolbar

To enable the Django Debug Toolbar, set the `ENABLE_DJANGO_DEBUG_TOOLBAR` variable to `true` in your `.env` file:

```text
ENABLE_DJANGO_DEBUG_TOOLBAR=true
```

## External repos

Repos used by this project are in separate repositories.
Expand Down
65 changes: 0 additions & 65 deletions backend/README.md

This file was deleted.

21 changes: 21 additions & 0 deletions backend/pycon/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,27 @@
# "qinspect.middleware.QueryInspectMiddleware",
]

# Django Debug Toolbar

ENABLE_DJANGO_DEBUG_TOOLBAR: bool = env.bool(
"ENABLE_DJANGO_DEBUG_TOOLBAR", default=False
)


if ENABLE_DJANGO_DEBUG_TOOLBAR:
INSTALLED_APPS.append("debug_toolbar")

MIDDLEWARE.insert(0, "debug_toolbar.middleware.DebugToolbarMiddleware")

DEBUG_TOOLBAR_CONFIG = {
"SHOW_TOOLBAR_CALLBACK": lambda _: DEBUG,
"SHOW_COLLAPSED": True,
}

INTERNAL_IPS = [
"127.0.0.1",
]

ROOT_URLCONF = "pycon.urls"

FORM_RENDERER = "custom_admin.template_backends.FormRenderer"
Expand Down
7 changes: 7 additions & 0 deletions backend/pycon/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@
path("", include("notifications.urls")),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)


if settings.DEBUG and settings.ENABLE_DJANGO_DEBUG_TOOLBAR:
from debug_toolbar.toolbar import debug_toolbar_urls

urlpatterns += debug_toolbar_urls()


urlpatterns = urlpatterns + [
path("", include(wagtail_urls)),
]
19 changes: 18 additions & 1 deletion backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,21 @@ name = "Python Italia"
text = "MIT"

[dependency-groups]
dev = ["mypy<2.0.0,>=1.2.0", "pytest==7.4.3", "pytest-cov==4.1.0", "pytest-django==4.6.0", "factory-boy==3.3.0", "pdbpp<1.0.0,>=0.10.3", "requests-mock<2.0.0,>=1.11.0", "pytest-mock<4.0.0,>=3.12.0", "pytest-cache<2.0,>=1.0", "time-machine<3.0.0,>=2.13.0", "libcst<2.0.0,>=1.1.0", "wagtail-factories<5.0.0,>=4.1.0", "pytest-xdist>=3.5.0", "websockets>=12.0", "typer>=0.12.3"]
dev = [
"mypy<2.0.0,>=1.2.0",
"pytest==7.4.3",
"pytest-cov==4.1.0",
"pytest-django==4.6.0",
"factory-boy==3.3.0",
"pdbpp<1.0.0,>=0.10.3",
"requests-mock<2.0.0,>=1.11.0",
"pytest-mock<4.0.0,>=3.12.0",
"pytest-cache<2.0,>=1.0",
"time-machine<3.0.0,>=2.13.0",
"libcst<2.0.0,>=1.1.0",
"wagtail-factories<5.0.0,>=4.1.0",
"pytest-xdist>=3.5.0",
"websockets>=12.0",
"typer>=0.12.3",
"django-debug-toolbar>=5.0.1",
]
15 changes: 15 additions & 0 deletions backend/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.