Django

Code

Ticket #10978 (closed: fixed)

Opened 11 months ago

Last modified 9 months ago

1.0 Url Include Documenation

Reported by: swatermasysk Assigned to: nobody
Milestone: Component: Documentation
Version: 1.0 Keywords: urls, urlpatterns, tutorial
Cc: Triage Stage: Ready for checkin
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

I found the documentation on setting up an include file for urls a little confusing for a new django user: http://docs.djangoproject.com/en/1.0/intro/tutorial03/#intro-tutorial03

The part I got tripped up on was code sample:

(r'polls/', include('mysite.polls.urls')),

It was not apparent to me until after I read the docs here http://docs.djangoproject.com/en/dev/topics/http/urls/ that the include was supposed to be part of the urlpatterns.

I mistakenly just added the include statement above and was greated with the error message, "'module' object has no attribute 'urlpatterns'". It could be just me, but I would recommend either expanding the code sample to include the urlpatterns or add a note about this potential error message.

Attachments

10978_inline_url_docs.diff (0.7 kB) - added by kfricovsky on 05/02/09 21:27:48.

Change History

05/02/09 21:27:48 changed by kfricovsky

  • attachment 10978_inline_url_docs.diff added.

05/25/09 22:52:31 changed by SmileyChris

  • needs_better_patch changed.
  • stage changed from Unreviewed to Ready for checkin.
  • needs_tests changed.
  • needs_docs changed.

06/18/09 08:36:41 changed by russellm

  • status changed from new to closed.
  • resolution set to fixed.

(In [11052]) Fixed #10978 -- Clarified that the include statement is part of the urlpattern definition. Thanks to swatermasysk for the suggestion.

06/18/09 09:18:14 changed by russellm

(In [11064]) [1.0.X] Fixed #10978 -- Clarified that the include statement is part of the urlpattern definition. Thanks to swatermasysk for the suggestion.

Merge of r11052 from trunk.


Add/Change #10978 (1.0 Url Include Documenation)




Change Properties
Action