reef-technologies / cookiecutter-rt-django

CookieCutter template for Django application projects with docker-compose etc.
BSD 3-Clause "New" or "Revised" License
19 stars 24 forks source link

Only import debug_toolbar when needed #81

Closed vbaltrusaitis-reef closed 1 year ago

vbaltrusaitis-reef commented 2 years ago

debug_toolbar version 3.2.1 causes a memory leak in one of our projects. This leak happens even if the toolbar is never used, never added to urlpatterns and DEBUG is set to False. The import is enough.

Newer toolbar versions don't cause this particular problem, but I'm still making the import conditional just in case.

See: https://github.com/vbaltrusaitis-reef/memleak-demo https://github.com/jazzband/django-debug-toolbar/issues/906