Take a look at middleware.

You can create a middleware which runs for every request. In 'process_request' 
you can check if the user is authenticated. If not... show or redirect to the 
login view.

The advantage is that you don't have to worry about placing decorators above 
your views.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bb02623a-2439-4c51-b05d-9f0f1bc2a78a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to