2👍
✅
You can do it like this:
from django.views.decorators.csrf import csrf_exempt, csrf_protect
@csrf_exempt
def user(request, string1, string2):
if request.method == "POST":
return HttpResponse(string1 + ' ' + string2)
else:
return HttpResponse('error')
I should add that csrf_exempt
is probably not safe…but will work.
Source:stackexchange.com