Skip to content Skip to sidebar Skip to footer

Accessing Session Variable In Django Template With Google App Engine (webapp) - Python

I have a Django template as my front-end. At the back-end, I used the sessions provided from Gaeutilities to store a variable (email). Front-end: {% if session.Email %} <

Solution 1:

You need to set your session object in a django template context, no?

template.render(temp, {'session':self.session})

Solution 2:

By doing so, you are just rendering the template with the session value. What happens is that when I click on a link to another page, and from that page return back to the same template, the session value are not being displayed. This is because I did not render the session value to the template from the page. What I wanted to do is to create a session at the back-end and traverse several pages and when I go back to the template, the session value can still be retrieved. Any ideas?

Post a Comment for "Accessing Session Variable In Django Template With Google App Engine (webapp) - Python"