@csrf_exempt stopped working in Django 1.4

前端 未结 3 1894
臣服心动
臣服心动 2021-02-05 11:14

I have the following code, that was working fine in Django 1.2.5:

from django.views.decorators.csrf import csrf_exempt

class ApiView(object):
    def __call__(s         


        
3条回答
  •  孤城傲影
    2021-02-05 12:02

    csrf_exempt has to decorate a function. In your urls you can decorate a that function, docs can be found here.

    (r'^vote/', permission_required('polls.can_vote')(VoteView.as_view())),
    

提交回复
热议问题