Review

Profile ClipperYard estimate view with debug toolbar in prod settings

ClipperYard is the work-order stack for wooden-boat restoration yards (caulking hours, spar varnish batches, bronze fastening kits). The yard-manager estimate page for re-planking jobs has been timing out under load. This PR enables django-debug-toolbar and flips DEBUG so we can capture SQL and template timing on the staging-like production module the dockside tablets already load from.

DjangoTier 1djangodebugsecuritysettings

Click a line to flag it, pick one or more labels, then submit. If the change looks correct, approve it.

clipperyard/settings/production.py+13-1
2828from .base import * # noqa: F401,F403
2929
3030ALLOWED_HOSTS = env.list("DJANGO_ALLOWED_HOSTS")
3131SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
3232SESSION_COOKIE_SECURE = True
3333CSRF_COOKIE_SECURE = True
3434
35-DEBUG = False
35+# Temporary: profile estimate_view SQL on dockside tablets
36+DEBUG = True
3637
38+INSTALLED_APPS += ["debug_toolbar"]
39+MIDDLEWARE = [
40+ "debug_toolbar.middleware.DebugToolbarMiddleware",
41+ *MIDDLEWARE,
42+]
43+
44+# Tablets hit the yard Wi-Fi NAT; always show the panel
45+def _show_toolbar(request):
46+ return True
47+
48+DEBUG_TOOLBAR_CONFIG = {"SHOW_TOOLBAR_CALLBACK": _show_toolbar}
3749
3850DATABASES["default"]["CONN_MAX_AGE"] = 60
3951STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"