First of all refer the doc of Django what Gora suggested you.<br>Use the print statement or pdb to trace the line.<br>I have doubt in the line<br> request.session['cityname'] = <b>cityname</b><br>you should write request.session['cityname'] = <b>request</b>.POST[cityname] or just check the value of cityname.<br>
Thanks.<br><br><div class="gmail_quote">On Sat, May 23, 2009 at 1:01 PM, Gora Mohanty <span dir="ltr"><<a href="mailto:gora@srijan.in">gora@srijan.in</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Sat, 23 May 2009 11:03:26 +0530<br>
Puneet Aggarwal <<a href="mailto:look4puneet@gmail.com">look4puneet@gmail.com</a>> wrote:<br>
<br>
> Hi All,<br>
><br>
> I am facing issue when I am trying to access session variables in django.<br>
><br>
> I am setting the session variable something like :<br>
><br>
> request.session['cityname'] = cityname<br>
</div>[...]<br>
<br>
This should work. Have you set MIDDLEWARE_CLASSES properly<br>
in settings.py, and added django.contrib.sessions to your<br>
INSTALLED_APPS? See the top of<br>
<a href="http://docs.djangoproject.com/en/dev/topics/http/sessions/" target="_blank">http://docs.djangoproject.com/en/dev/topics/http/sessions/</a><br>
or the appropriate documentation version for your Django<br>
version.<br>
<br>
Regards,<br>
Gora<br>
_______________________________________________<br>
BangPypers mailing list<br>
<a href="mailto:BangPypers@python.org">BangPypers@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/bangpypers" target="_blank">http://mail.python.org/mailman/listinfo/bangpypers</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Praveen Kumar<br>+91 9739854134<br><a href="http://praveensunsetpoint.wordpress.com">http://praveensunsetpoint.wordpress.com</a><br>Bangalore<br>