Django报错 'X-Frame-Options' to 'deny'.

访问页面报错:

Refused to display '页面url' in a frame because it set 'X-Frame-Options' to 'deny'.

【解决方法】settings.py增加

X_FRAME_OPTIONS = 'SAMEORIGIN'

【原因】在Django 3.0中,X_FRAME_OPTIONS的默认设置从SAMEORIGIN 变成了DENY

https://docs.djangoproject.com/en/3.0/ref/clickjacking/



作者:penny20
链接:https://www.jianshu.com/p/ca845ef14524
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
原文地址:https://www.cnblogs.com/shenZS/p/13468894.html