Opened 18 years ago
Closed 18 years ago
#3981 closed (invalid)
naming-url-patterns
Reported by: | Owned by: | Jacob | |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
http://www.djangoproject.com/documentation/url_dispatch/#naming-url-patterns
urlpatterns = patterns('', url(r'/archive/(\d{4})/$', archive, name="full-archive"), url(r'/archive-summary/(\d{4})/$', archive, {'summary': True}, "arch-summary"), )
should be
urlpatterns = patterns('', url(r'/archive/(\d{4})/$', archive, name="full-archive"), url(r'/archive-summary/(\d{4})/$', archive, {'summary': True}, name="arch-summary"), )
Note:
See TracTickets
for help on using tickets.
Both forms are correct. You only have to use keyword arguments when one of the four positional arguments are missing.