A
A
Andrew2012-03-01 00:52:30
Django
Andrew, 2012-03-01 00:52:30

Login required in django

Good afternoon!
I tried to find how in django to make the login required for everything except the login page, but I did not find it.
Can someone advise?
Thank you!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
C
cuprum, 2012-03-01
@cuprum

For example, write middleware stackoverflow.com/questions/2164069/best-way-to-make-djangos-login-required-the-default

U
un1t, 2012-03-01
@un1t

What's so hard about adding a decorator to a function? If it’s tiring to add to a lot of functions, then you can use class based views to create a base class and wrap the dispatch method with a decorator. The rest of the views respectively inherit from this class.

A
alternativshik, 2012-03-01
@alternativshik

decorator @login_required

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question