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
| 28 | 28 | from .base import * # noqa: F401,F403 | |
| 29 | 29 | ||
| 30 | 30 | ALLOWED_HOSTS = env.list("DJANGO_ALLOWED_HOSTS") | |
| 31 | 31 | SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https") | |
| 32 | 32 | SESSION_COOKIE_SECURE = True | |
| 33 | 33 | CSRF_COOKIE_SECURE = True | |
| 34 | 34 | ||
| 35 | - | DEBUG = False | |
| 35 | + | # Temporary: profile estimate_view SQL on dockside tablets | |
| 36 | + | DEBUG = True | |
| 36 | 37 | ||
| 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} | |
| 37 | 49 | ||
| 38 | 50 | DATABASES["default"]["CONN_MAX_AGE"] = 60 | |
| 39 | 51 | STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" |