[Fixed]-Refused to display iframe or embed tag in django 3.0 and chrome


After going through a lot of similar questions and trying lots of different things, I finally found a solution for my problem thanks to the django documentation.

Since Django 3.0. The default value of the X_FRAME_OPTIONS setting was changed from SAMEORIGIN to DENY.

So I just had to add X_FRAME_OPTIONS = 'SAMEORIGIN' to settings.py and the problem was gone.

I still don’t know what change made my code stop working because I already used django 3.0 version since it was released, probably it was a Chrome update.


Recording an incident here specifically with a Vimeo embedded video. I needed to set SECURE_REFERRER_POLICY to None. The default was changed in Django 3.1.

Leave a comment