Changes between Initial Version and Version 1 of Ticket #29611
- Timestamp:
- Jul 30, 2018, 8:03:09 AM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #29611
- Property Resolution → needsinfo
- Property Status new → closed
-
Ticket #29611 – Description
initial v1 2 2 3 3 To explain the problem, lets have the example for url name: "login" 4 Order of INSTALLED_APPS = [ 4 {{{ 5 INSTALLED_APPS = [ 5 6 'django.contrib.admin', 6 7 'django.contrib.auth', # There lies a url named login with pattern /accounts/login … … 10 11 'custom_app', 11 12 ] 12 13 }}} 13 14 14 15 Now in the project/urls.py, I provide a different pattern for 'login', 15 16 {{{ 16 17 urlpatterns = [ 17 18 # Auth urls 18 19 re_path(r'^login/$', auth_views.login, name='login'), # I removed the default accounts prefix from the login url 19 20 ] 20 21 }}} 21 22 Now, in this case if I do: 22 reverse("login") -> the result will be /accounts/login 23 but if I do: url 'login' in a template -> the result will be /login/23 `reverse("login")` -> the result will be `/accounts/login` 24 but if I do: `{% url 'login' %}` in a template -> the result will be `/login/`