django報(bào)錯(cuò)解決 Forbidden (403) CSRF verification failed. Request aborted.
報(bào)錯(cuò)內(nèi)容
Forbidden (403)
CSRF verification failed. Request aborted.
Help
Reason given for failure:
Origin checking failed - https://active-mantis-distinct.ngrok-free.app does not match any trusted origins.
In general, this can occur when there is a genuine Cross Site Request Forgery, or when Django’s CSRF mechanism has not been used correctly. For POST forms, you need to ensure:
解決辦法
setting.py 文件加入以下內(nèi)容
www.***.com
為你當(dāng)前訪問域名文章來源:http://www.zghlxwxcb.cn/news/detail-703352.html
CSRF_TRUSTED_ORIGINS = ['https://**.com',]
搞定文章來源地址http://www.zghlxwxcb.cn/news/detail-703352.html
到了這里,關(guān)于django報(bào)錯(cuò)解決 Forbidden (403) CSRF verification failed. Request aborted.的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!