POST method always return 403 Forbidden

前端 未结 7 1707
走了就别回头了
走了就别回头了 2021-02-19 01:46

I have read Django - CSRF verification failed and several questions (and answers) related to django and POST method. One of the best-but-not-working-for-me answer is https://sta

7条回答
  •  时光取名叫无心
    2021-02-19 02:03

    You need to use RequestContext with your response

    for example in view.py file

    from django.template import RequestContext
    
    def home(request):
        return render_to_response('home.html',RequestContext(request, {}))
    

提交回复
热议问题