Can login_required be applied to the whole application?

Can I use the login_required decorator for the entire application? When I say "application", I mean this in the sense of django, that is, a lot of URLs and views, and not the whole project.

+4
source share
3 answers

Yes, you must use middleware.

Try looking at solutions that have some differences:

+5
source

I think that you are looking for this fragment containing the required middleware login.

+1
source

This is an old question. But here goes:

Enable Django Decorator

This is a replacement for include in URLConf. Pefect to use login_required for the whole application.

0
source

Source: https://habr.com/ru/post/1304433/


All Articles