Opened 16 years ago

Closed 16 years ago

Last modified 12 years ago

#7714 closed (fixed)

corrected documentation for {% url %} resolver

Reported by: V Owned by: nobody
Component: Documentation Version: dev
Severity: Keywords: url resolver
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description (last modified by Malcolm Tredinnick)

there were two errors:

  1. ('^client/(\d+)/$', 'app_name.app_views.client') originally ('^client/(\d+)/$', 'app_views.client')

gives you an ImportError (ViewDoesNotExist)

  1. {% url app_name.app_views.client client.id %} originally {% url app_views.client client.id %}

simply doesn't work

to check I did:

  1. startapp app_name
  2. add urls.py to the main urls.py as in the docs
  3. add urls.py to app_name/urls.py as shown above
  4. creates app_views.py with view client that gives back {% url app_views.client client.id %}

Attachments (2)

patch.txt (884 bytes ) - added by Viktor <viktor.nagy@…> 16 years ago.
7714.url_tag_doc.diff (829 bytes ) - added by Julien Phalip 16 years ago.
Revised Viktor's patch, adding 'project_name' to the paths

Download all attachments as: .zip

Change History (7)

by Viktor <viktor.nagy@…>, 16 years ago

Attachment: patch.txt added

comment:1 by Malcolm Tredinnick, 16 years ago

Description: modified (diff)

Unbroke description.

comment:2 by Marc Garcia, 16 years ago

milestone: 1.0
Patch needs improvement: set
Triage Stage: UnreviewedAccepted

I agree on that, but I think that to correct it isn't enough to add the application name, it's also needed to add the project name.

So app_views.client should be project_name.app_name.app_views.client

by Julien Phalip, 16 years ago

Attachment: 7714.url_tag_doc.diff added

Revised Viktor's patch, adding 'project_name' to the paths

comment:3 by Julien Phalip, 16 years ago

Triage Stage: AcceptedReady for checkin

comment:4 by Jacob, 16 years ago

Resolution: fixed
Status: newclosed

(In [8332]) Clarified a bit of the {% url %} documentation. Fixes #7714.

comment:5 by Jacob, 12 years ago

milestone: 1.0

Milestone 1.0 deleted

Note: See TracTickets for help on using tickets.
Back to Top