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.
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.
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