Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#10978 closed (fixed)

1.0 Url Include Documenation

Reported by: swatermasysk Owned by: nobody
Component: Documentation Version: 1.0
Severity: Keywords: urls, urlpatterns, tutorial
Cc: Triage Stage: Ready for checkin
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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 (1)

10978_inline_url_docs.diff (762 bytes) - added by kfricovsky 6 years ago.

Download all attachments as: .zip

Change History (4)

Changed 6 years ago by kfricovsky

comment:1 Changed 6 years ago by SmileyChris

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Ready for checkin

comment:2 Changed 6 years ago by russellm

  • Resolution set to fixed
  • Status changed from new to closed

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

comment:3 Changed 6 years ago 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.

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