Sending a DELETE request from a form in Django

前端 未结 2 1934
-上瘾入骨i
-上瘾入骨i 2021-01-03 02:32

I am trying to send a DELETE request from a form in Django taking help from jQuery referring following link below;

https://baxeico.wordpress.com/2014/06/25/put-and-d

2条回答
  •  一向
    一向 (楼主)
    2021-01-03 03:10

    It's probably the ordering of your middleware. When the request is received, the middleware is processed in the order that it is specified in the settings. In your case, that means the CSRF middleware is run first, sees that the request is a POST without a CSRF token, and raises the error.

    Try moving your HttpPostTunnelingMiddleware before the CsrfViewMiddleware.

提交回复
热议问题