I have a little problem figuring out how {% url 'something' %} works in django templates.
When I launch my site in debug mode, I see this in standard mode:
web_1 | [21/Dec/2015 11:29:45] "GET /accounts/profile HTTP/1.1" 302 0 web_1 | /usr/local/lib/python3.5/site-packages/django/template/defaulttags.py:499: RemovedInDjango110Warning: Reversing by dotted path is deprecated (django.contrib.auth.views.login). web_1 | url = reverse(view_name, args=args, kwargs=kwargs, current_app=current_app) web_1 |
The / accounts / profile cards are mapped to a template, and the only place in this template that django.contrib.auth.views.login mentions is the following:
<a href="{% url 'django.contrib.auth.views.logout' %}?next={% url 'django.contrib.auth.views.login' %}">Log out</a>
So, I think that for some reason this is the wrong way to use the {% url%} command. What is the right way? How to get rid of this warning?
Here are my urlpatterns:
urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^accounts/', include('django.contrib.auth.urls')), url(r'^accounts/profile', views.profile_view), url(r'^$', RedirectView.as_view(url=reverse_lazy(views.profile_view))) ]
source share