#31467: Possible error in the doc "Writing your first Django app, part 1"
-----------------------------------------+------------------------
               Reporter:  madaneau       |          Owner:  nobody
                   Type:  Bug            |         Status:  new
              Component:  Documentation  |        Version:  3.0
               Severity:  Normal         |       Keywords:
           Triage Stage:  Unreviewed     |      Has patch:  1
    Needs documentation:  0              |    Needs tests:  0
Patch needs improvement:  0              |  Easy pickings:  0
                  UI/UX:  0              |
-----------------------------------------+------------------------
 There is something not working in the
 [https://docs.djangoproject.com/en/3.0/intro/tutorial01/ first step of the
 Django tutorial].

 near the end of the page,** mysite/urls.py** is defined as :

 {{{
 #!div style="font-size: 80%"
   {{{#!python
 from django.contrib import admin
 from django.urls import include, path

 urlpatterns = [
     path('polls/', include('polls.urls')),
     path('admin/', admin.site.urls),
 ]
   }}}
 }}}

 When I runserver with this, I got the error :

 {{{
  File "/home/myuser/dev/mysite1/mysite1/urls.py", line 25, in <module>
     path('polls/', include('polls.urls')),
 NameError: name 'include' is not defined
 }}}

 To solve this, I added this to **mysite/urls.py** :

 {{{
 from django.conf.urls import include
 }}}

 I'm not sure this is the best way to solve the error, but it works.
 Thanks.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/31467>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/051.cce344ec01d062a713cae3b8332de4fa%40djangoproject.com.

Reply via email to