tags:

views:

50

answers:

1

Hi, Im writing an app that will display the register view depending if is first time visitor.

What and How is the better way to do this with Django?

thxs.

+2  A: 

Use sessions: http://docs.djangoproject.com/en/1.2/topics/http/sessions/#topics-http-sessions

And then do something like:

def my_view(request, *args, **kwargs):
    if request.session.get('visited', False):
        # response without the welcome message
    else:
        request.session['visited'] = True
        # response with the welcome message

For session-related settings (e.g. expiration), see http://docs.djangoproject.com/en/1.2/topics/http/sessions/#settings

rz
hi rz, which is the expiration date for this session?
panchicore