Html Django X_FRAME_选项仅适用于特定媒体URL

Html Django X_FRAME_选项仅适用于特定媒体URL,html,django,html-object,Html,Django,Html Object,当使用django的静态url显示pdf时,下面的代码与标记配合得非常好 我可以在浏览器控制台中看到一个错误- Refused to display 'http://localhost:8000/v.pdf' in a frame because it set 'X-Frame-Options' to 'deny'. 但找不到任何解决方案,我到底需要做什么才能在媒体URL中允许“X帧选项” 更新 这解决了这个问题,但是对于我设置的所有URLSAMEORIGIN,是否有任何方法可以仅为特定的媒体

当使用django的静态url显示
pdf
时,下面的代码与标记配合得非常好

我可以在浏览器控制台中看到一个错误-

Refused to display 'http://localhost:8000/v.pdf' in a frame because it set 'X-Frame-Options' to 'deny'.
但找不到任何解决方案,我到底需要做什么才能在媒体URL中允许“X帧选项”

更新 这解决了这个问题,但是对于我设置的所有URL
SAMEORIGIN
,是否有任何方法可以仅为特定的
媒体URL设置
X\u FRAME\u选项

<object data="{% get_media_prefix %}v.pdf" type="application/pdf" height="800" width="650"></object>
<object data="{{media_pdf_url}}" type="application/pdf" height="800" width="650"></object>
Refused to display 'http://localhost:8000/v.pdf' in a frame because it set 'X-Frame-Options' to 'deny'.