YouTube embeds fail with a 153 error
AI-generated summary of reporting by Simon Willison’s Weblog. Read the original for the full story.
Why it matters
Django sites using SecurityMiddleware's default Referrer-Policy silently break YouTube embeds with Error 153; switching to strict-origin-when-cross-origin fixes it.
Simon Willison's blog had a problem where some YouTube videos shown on his site displayed an error instead of playing. The cause was a security setting that stopped his website from telling YouTube who was sending visitors. He changed one line of his website's settings to fix it.
A one-line Django configuration change resolves YouTube Error 153 on embedded videos. Sites relying on Django's SecurityMiddleware default Referrer-Policy of same-origin send no referer to YouTube, violating YouTube's embedded player terms. Organizations running Django with video embeds should verify their SECURE_REFERRER_POLICY setting; the fix carries a minor privacy trade-off, revealing site origin on outbound links.
Django's SecurityMiddleware defaults to Referrer-Policy: same-origin, suppressing the Referer header on cross-origin requests. YouTube's embedded player requires the HTTP Referer for client identification, producing 'Error 153: Video player configuration error'. Fix: set SECURE_REFERRER_POLICY = 'strict-origin-when-cross-origin' in settings.py, which sends only the origin cross-origin. Willison delegated the fix to a GitHub Copilot agent via pull request #562.
Read the original
This summary exists to save you time, not to replace the source.
Key terms
Was this summary useful?
One click, anonymous. It tells us which summaries to re-run.
Related reading
Code-driven AI illustrations are more useful than images from dedicated image models
Code-driven AI illustrations let designers edit assets directly in code, saving time on iteration and ensuring consistency, which is a game-changer for teams that need rapid, reusable visual content.
A hierarchical note-taking app for building large personal knowledge bases
Trilium lets users build and navigate massive personal knowledge bases without duplicating content, saving time on organization and retrieval.
Desktop apps in Go with native UI or web frontend
Go developers can now ship cross-platform desktop and mobile apps in a single small binary without cgo or heavy runtimes, cutting build complexity and deployment size.
OpenBitFun: an agent workspace with four harness modes and phone remote control
OpenBitFun lets agents run on any machine and be controlled from a phone, eliminating the need to choose between local power and remote access, saving developers time switching contexts.
Intel One Mono: a monospaced font designed with low-vision developers
Developers with low vision or eye fatigue can read code more clearly, reducing errors and improving productivity.