Answer the question
In order to leave comments, you need to log in
How to access login_required url?
There means url:
url(r'^links$', login_required(views.LinkListView.as_view()), name='links')
class LinkListView(ListView):
model = Link
template_name = "app/links.html"
href="{% url 'links' %}"
NoReverseMatch
Answer the question
In order to leave comments, you need to log in
url(r'^links$', login_required(views.LinkListView.as_view(), login_url=reverse_lazy('your_login_url')), name='links')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question