I am setting
request.session['total_items'] = 3
in a views.py file of a django app
in template
i got to know that you can access it as {{request.session.total_items}}
Everything is fine and i'm able to get the value.
However,my question is that why it is not {{request.session['total_items']}}
instead, since request.session is a dictionary like object.
For {{request.session['total_items']}}
, its giving an error as following:
Could not parse the remainder: '['total_items']' from 'request.session['total_items']'
Any help would be appreciated ...