I am stuck in django and would really appreciate it if someone could help me.
I need to have an entry point for a 3rd party API. So I created a view and decorated it with @csrf_exempt
Now the problem is I am not able to access any session variables I set before. edit - I set multiple session variables like user email to know if a user is already logged in. I was able to use the session before calling the 3rd party API. When the 3rd party API sends a response, they don't send CSRF token hence I have exempt that view from csrf. Once I receive a valid response I want to update my database. To do that, I need to know the email id of the user which I lost since I don't have session variables anymore.
ppConfirmPaymentProcess
is another function that processes the POST data sent by this 3rd party API.
Everything is working fine, csrf_exempt is also working fine but I can't do request.session["foo"]
with this request. Can someone please help?
@csrf_exempt
def ppConfirmPayment(request):
print(request.session, "=======================================")
for key, value in request.session.items():
print('{} => {}'.format(key, value))
return ppConfirmPaymentProcess(request)