Commit e8f37050 authored by Florent Chehab's avatar Florent Chehab
Browse files

Restored django debug toolbar in the api panel

parent b740f2dd
......@@ -54,6 +54,8 @@ if os.environ["ENV"] == "DEV":
INSTALLED_APPS += ["django_extensions", "debug_toolbar"]
MIDDLEWARE = ["debug_toolbar.middleware.DebugToolbarMiddleware"] + MIDDLEWARE
DEBUG_TOOLBAR_CONFIG = {"SHOW_TOOLBAR_CALLBACK": "base_app.utils.show_toolbar"}
DEBUG = False
......@@ -66,7 +68,6 @@ WEBPACK_LOADER = {
ALLOWED_PHOTOS_EXTENSION = ["jpg", "jpeg", "png", "svg"]
LOGIN_URL = "/user/login"
def show_toolbar(request) -> bool:
Function to tell when to show the django debug toolbar.
It was having an issue inside docker.
The django debug toolbar is displayed only when in /api/...
if request.is_ajax():
return False
url = request.get_full_path()
return "/api/" in url or "__debug__" in url
return True
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment