This is my view.py I am trying to get a response from a Payment Gateway but m getting an 403 Forbidden CSRF verification failed. Request aborted. after Payment I exempted CSRF Token for the view but still its showing same Error
from django.views.decorators.csrf import csrf_exempt
@csrf_exempt
def resp(request, encResp):
print " RESPONSE WITH CSRF EXEMPT "
'''
Please put in the 32 bit alphanumeric key in quotes provided by CCAvenues.
'''
workingKey = WorkingKey
decResp = decrypt(encResp,workingKey)
data = '<table border=1 cellspacing=2 cellpadding=2><tr><td>'
data = data + decResp.replace('=','</td><td>')
data = data.replace('&','</td></tr><tr><td>')
data = data + '</td></tr></table>'
html = '''\
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Response Handler</title>
</head>
<body>
<center>
<font size="4" color="blue"><b>Response Page</b></font>
<br>
$response
</center>
<br>
</body>
</html>
'''
fin = Template(html).safe_substitute(response=data)
return HttpResponse(fin)
I read many solutions on stackoverflow and tried but still cant get it right
My main urls.py
url(r'^booked/', include('booking.urls')),
My urls.py in app named booking
urlpatterns = patterns('',
url(r'^responce-cc/', "booking.views.resp", name="cc_response_url"),)
and the redirect url I am passing to payment gateway is
https://www.mysitename.com/booked/responce-cc/