Hi,

I'm kind of stuck, the documentation says that request.session should
be used like a dictionary but if I use a for-loop in a template an try
to loop over a session like this "for key, value in session" just like
I would access items in an ordinary dictionary, I always get a
KeyError and can't figure out why.

The request.session is linked to 'session' for the context of the
request and I can get values out of request.session with dot notation
in the template.

I guess I'm doing something wrong and I'm going to keep looking, but
does anyone have a hint for an easy way of debugging the values in a
session?

Thanks!

Cheers,

Bert

----

This is what the error debug page says (hope the html and special
characters make it through the post):

Request Method: GET
Request URL:    http://colima:8000/visitor/language/fr/
Exception Type: KeyError
Exception Value:        0
Exception Location:     /Library/Frameworks/Python.framework/Versions/2.5/
lib/python2.5/site-packages/django/contrib/sessions/backends/base.py
in __getitem__, line 31
Python Executable:      /Library/Frameworks/Python.framework/Versions/2.5/
Resources/Python.app/Contents/MacOS/Python
Python Version: 2.5.0

1       {% load i18n %}
2       {% extends "base.html" %}
3
4       {% block header %}
5       <h1>{{ title }}</h1>
6       {% endblock %}
7
8       {% block content %}
9       This is the language from the session: {{ session.django_language }}
10      <p>
11      {% for key, value in session %}
12          {{ key }}: {{ value }}
13      {% endfor %}

...


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to