How to exempt CSRF Protection on direct_to_template

后端 未结 2 1221
予麋鹿
予麋鹿 2020-12-14 05:54

I have a flow in my django application in which I redirect the user to another service (e.g. PayPal) which after some its own processing, returns the user back on my own ser

2条回答
  •  醉话见心
    2020-12-14 06:25

    You can Use @csrf_exempt decorator to excempt csrf token for this you have to import

    from django.views.decorators.csrf import csrf_exempt
    

    then write @csrf_exempt before your view

    this will work properly :)

提交回复
热议问题