how can I limit to display a message only upon the login

I would like to learn how to limit a particular part of a template to be displayed upon the user login. E.g. the greeting message in the home page will be displayed once after the user's successful login but not again on the consecutive visit of the home page during the same session. I guess it could be possible by use of the HTTP_referrer. I will appreciate if someone can guide me by some examples.

-------------Problems Reply------------

Check our django user messages. You can set a message via something like this (in your view):

request.user.message_set.create(message="Thanks for logging in!")

Then, display them (from the django docs):

{% if messages %}
{% for message in messages %}
<li>{{ message }}</li>
{% endfor %}
{% endif %}

Category:django Views:0 Time:2009-11-04

Related post

Copyright (C), All Rights Reserved.

processed in 0.182 (s). 11 q(s)