Having a POST'able API and Django's CSRF Middleware

前端 未结 3 414
春和景丽
春和景丽 2020-12-08 14:17

I have a Django webapp that has both a front-end, web-accessible component and an API that is accessed by a desktop client. However, now with the new CSRF middleware compon

3条回答
  •  庸人自扰
    2020-12-08 14:40

    Since Django 1.1, the CSRF code will automatically allow AJAX requests to pass through, since browsers seem to do proper security checks. Here is the original commit and the documentation.

提交回复
热议问题