I am making a webpage. There are two views. Index and Detail.
In index I setup the cookie for user using response.set_cookie('key', key) where response = HttpResponseRedirect(file_url). In detail function when I try to get data from cookie using
if 'key' not in request.cookies:
key = request.COOKIES['key']
I am getting error: 'WSGIRequest' object has no attribute 'cookies'.
Detailed error link : http://dpaste.com/1P017V6
Please help me!. Thanks in advance.
You typed request.cookies, but cookies must be upper case. Try with this:
if 'key' not in request.COOKIES:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With