Answer the question
In order to leave comments, you need to log in
How to organize work on the site only after authorization?
I already asked this question. There he is. I don't know how to draw more attention to him, but I need help.
I thought that this is already implemented in the dzhangi admin panel. But I don’t know how to implement the same at home, or how to use their code in my project. Just not enough knowledge. Please help with some advice. Maybe someone has already implemented something similar? Share your experience.
Thank you all in advance.
Answer the question
In order to leave comments, you need to log in
For example, if you use common based views:
from django.contrib.auth.decorators import login_required
class LoginRequiredMixin(object):
@classmethod
def as_view(cls, **initkwargs):
view = super(LoginRequiredMixin, cls).as_view(**initkwargs)
return login_required(view, login_url=reverse_lazy('login'))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question