i am trying to learn django from django documentation but i am getting an error message in the first part of the documentation

43 views
Skip to first unread message

vatsal narula

unread,
Jun 23, 2021, 11:19:18 AM6/23/21
to Django users

Using the URLconf defined in blogs.urls, Django tried these URL patterns, in this order:

admin/ The current path, polls/, didn’t match any of these. this is the error i am getting after i wrote the following code:

  1. for urls.py

    from django.contrib import admin from django.urls import include, path urlpatterns = [ path('polls/', include('polls.urls')), path('admin/', admin.site.urls), ]
  2. for polls/urls.py

    from django.urls import path from . import views urlpatterns = [ path('', views.index, name='index'), ]

3.for polls/views.py

 """ from django.http import HttpResponse

def index(request): return HttpResponse("Hello, world. You're at the polls index.") """

how i can i remove this error in vs code

Symaxx

unread,
Jun 25, 2021, 9:30:00 AM6/25/21
to django...@googlegroups.com
I started learning Django from the documentation but it was very hard for me and it took me a very long time to grasp the concept 

I suggest you try using books by w.s vincent http://wsvincent.com/books/ these are the best for me and them help you stay engaged   

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5750b076-eddf-400d-b180-4ec7d46aa0e3n%40googlegroups.com.

Lalit Suthar

unread,
Jul 4, 2021, 1:25:46 PM7/4/21
to django...@googlegroups.com
rewrite polls/urls.py like below

path(''", views.index, name='index'), 
Reply all
Reply to author
Forward
0 new messages