1
The use of patterns()
makes the use of url()
optional. Going forward, however, patterns
will be deprecated and you will have to always use url
. See this ticket:
The other thing that
patterns
provides besides the prefix parameter is automatically wrapping plain tuples inurlpatterns
inurl()
. I think removing this and forcing usage ofurl()
will be a good cleanup.
So you should get in the habit of always using url
.
0
Thank you for clarification with your edit:
- First one points to the view
- second one allows you to add another patterns list from separate module (or from the same one)
But usage of url
is purely for convenience (but will be required in django 2.0). You can see the check here:
https://github.com/django/django/blob/master/django/conf/urls/init.py#L55
- [Answer]-Django: How to display an older version of a queryset in template that has been modified in views.py?
- [Answer]-Django manage.py syncdb : expected string or buffer?
Source:stackexchange.com