diff --git a/pgweb/settings.py b/pgweb/settings.py index f9782dc0..f8b7e19f 100644 --- a/pgweb/settings.py +++ b/pgweb/settings.py @@ -162,5 +162,15 @@ FRONTEND_SMTP_RELAY = "magus.postgresql.org" # Where to relay use OAUTH = {} # OAuth providers and keys PGDG_ORG_ID = -1 # id of the PGDG organisation entry +# For debug toolbar, can then be fully configured in settings_local.py +DEBUG_TOOLBAR = False +INTERNAL_IPS = [ + '127.0.0.1', +] + # Load local settings overrides from .settings_local import * + +if DEBUG and DEBUG_TOOLBAR: + MIDDLEWARE.append('debug_toolbar.middleware.DebugToolbarMiddleware') + INSTALLED_APPS.append('debug_toolbar') diff --git a/pgweb/urls.py b/pgweb/urls.py index 3d4d0ca6..0fd54b41 100644 --- a/pgweb/urls.py +++ b/pgweb/urls.py @@ -1,5 +1,7 @@ from django.conf.urls import include, url +from django.urls import path from django.views.generic import RedirectView +from django.conf import settings import pgweb.contributors.views import pgweb.core.views @@ -156,3 +158,10 @@ urlpatterns = [ # Fallback for static pages, must be at the bottom url(r'^(.*)/$', pgweb.core.views.fallback), ] + + +if settings.DEBUG_TOOLBAR: + import debug_toolbar + urlpatterns = [ + path('__debug__/', include(debug_toolbar.urls)), + ] + urlpatterns