Is the {% csrf_token %} CSRF protection tag still necessary in Django 1.2?

岁酱吖の 提交于 2019-12-05 10:19:14
Rich

After more investigation it appears the {% csrf_token %} is always inserted if the form has method post and not if it doesn't. Very clever auto protection from Django.

Josh Smeaton

From the documentation:

In Django 1.1, the template tag did not exist. Instead, a post-processing middleware that re-wrote POST forms to include the CSRF token was used. If you are upgrading a site from version 1.1 or earlier, please read this section and the Upgrading notes below.

http://docs.djangoproject.com/en/dev/ref/contrib/csrf/#legacy-method

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!