KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I want to redirect access of unauthenticated users to the login page, after which the logged-in user should be redirected to the originally requested page. According to documentation, this is easily achieved using the @user_passes_test decorator. But it seems I'd have to decorate every view, which is crazy, there are too many and it's error-prone. What is a good way to turn on this functionality globally (except for a small fixed set of views, such as login )? That is, default everything to logged-in-only + handle anonymous viewing explicitly, where needed.
Tags (comma-separated)
Save Edits
Cancel