Is there a way I can apply the login_required decorator to an entire app? When I say "app" I mean it in the django sense, which is to say a set of urls and views, not an entire project.
views:
113answers:
2
+1
A:
I think you are looking for this snippet, containing login-required middleware.
Wogan
2010-03-18 06:38:13
+3
A:
Yes, you should use middleware.
Try to look through solutions which have some differences:
- http://www.djangosnippets.org/snippets/1179/ - with list of exceptions.
- http://www.djangosnippets.org/snippets/1158/ - with list of exceptions.
- http://www.djangosnippets.org/snippets/966/ - conversely with list of login required urls.
- http://www.djangosnippets.org/snippets/136/ - simplest.
Leonid Shvechikov
2010-03-18 11:58:24