Opened 7 years ago

Closed 7 years ago

#28338 closed Bug (invalid)

Missing import in tutorial part 1

Reported by: Kieran Mathieson Owned by: nobody
Component: Documentation Version: 1.11
Severity: Normal Keywords: Documentation, Tutorial, Windows
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Django 1.11, Python 3.6, Windows 10 (don't judge)

Development server (python manage.py runserver)

In:

https://docs.djangoproject.com/en/1.11/intro/tutorial01/#write-your-first-view

Code for mysite/urls.py is:

from django.conf.urls import include, url
from django.contrib import admin

urlpatterns = [
    url(r'^polls/', include('polls.urls')),
    url(r'^admin/', admin.site.urls),
]

Need to import include() for this to run in environment given above.

from django.conf.urls import url
from django.contrib import admin
from django.conf.urls import include

urlpatterns = [
    url(r'^polls/', include('polls.urls')),
    url(r'^admin/', admin.site.urls),
]

This has been reported before in https://code.djangoproject.com/ticket/27553, but the ticket was marked as invalid with no explanation that I could see.

Django rox!!

Change History (1)

comment:1 by Tim Graham, 7 years ago

Resolution: invalid
Status: newclosed

It looks like you didn't notice the line from django.conf.urls import include, url in the documentation (it contains two imports).

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