On 2010-05-26, at 15:02 , Nuno Maltez wrote:
>
> http://docs.djangoproject.com/en/dev/topics/http/sessions/#using-sessions-in-views
>
>
>>if request.session.get('has_visited',True):
>
> You're passing True as the default value to the get method - get(key,
> default=None); this means that
Also move :
request.session['has_visited'] = True
above the return statement.
On May 26, 4:02 pm, Nuno Maltez wrote:
> http://docs.djangoproject.com/en/dev/topics/http/sessions/#using-sess...
>
> > if request.session.get('has_visited',True):
>
> You're passing True as
http://docs.djangoproject.com/en/dev/topics/http/sessions/#using-sessions-in-views
> if request.session.get('has_visited',True):
You're passing True as the default value to the get method - get(key,
default=None); this means that when 'has_visited' isn't set in your
session (1st visit) it
Hi,
a simple hint: try to point out a place in your code where
has_visited does exist and is set to False.
Also, you probably don't want to have any code in your view after an
unconditional "return" statement - that code would never get executed.
HTH
Jikra
--
You received this
Hi,
When the user enters a site for the first time they should see a flash
version of the logo. All other times they should see a gif image. My
home view looks like:
if request.session.get('has_visited',True):
visited = True
else:
visited = False
t =
5 matches
Mail list logo