A
A
Anton2017-03-13 22:22:19
Django
Anton, 2017-03-13 22:22:19

How to enter url by name in @login_required?

Hello. I'm trying to do this @login_required(login_url=reverse('login'))but it doesn't work, the web server writes

"django.core.exceptions.ImproperlyConfigured: The included URLconf 'BaseApp.urls' does not appear to have any patterns in it. If you see valid patterns in the file then the issue is probabl y caused by a circular import."

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
ipanov, 2017-03-14
Reytarovsky @Antonchik

reverse needs to be replaced with reverse_lazy.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question