Django tutorial question

28 views
Skip to first unread message

TJ Marbois

unread,
Oct 6, 2012, 6:45:10 PM10/6/12
to django...@googlegroups.com
Hi

going thru the Django tutorial - and got to this part:


my editor has a python lint program running...and it complains about 'include' at the import being written but unused...

is there any reason this is left in for the tutorial? or is this just a not needed leftover or error?  I just want to be sure I am not missing some detail....because it works with or without...Im just wondering why they left it in.

from django.conf.urls import patterns, include, url

urlpatterns = patterns('polls.views',
    url(r'^$', 'index'),
    url(r'^(?P<poll_id>\d+)/$', 'detail'),
    url(r'^(?P<poll_id>\d+)/results/$', 'results'),
    url(r'^(?P<poll_id>\d+)/vote/$', 'vote'),
)

Lee Hinde

unread,
Oct 7, 2012, 12:25:28 AM10/7/12
to django...@googlegroups.com
TJ Marbois wrote:
--
It's not used in that example. It is a common pattern to use it in more complex apps.  It's explained here: https://docs.djangoproject.com/en/1.4/topics/http/urls/#include



TJ Marbois

unread,
Oct 7, 2012, 12:27:59 AM10/7/12
to django...@googlegroups.com
Ah ok thanks.... was just curious as to why it was still lingering if it wasn't used in the example.

just a tiny bit confusing but all still worked!  - thanks for the reply.

Tj
Reply all
Reply to author
Forward
0 new messages