In Django how to add login required for entire app?


This Content is from Stack Overflow. Question asked by Manoj Kamble

Suppose I have 3 apps in my Django website app_1, app_2, app_3. app_1 and app_2 can access any user, but for app_3 I want the user should log in.

Using login_required I can achieve this. But I have more than 30 views and urls. I don’t want to write login_required decorator on every view function. Is there any other shortcut?


This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?