0
votes

I am going throught the Django tutorial here:

https://docs.djangoproject.com/en/1.10/intro/tutorial01/

I follow the instructions exactly. But when I try to go to http://localhost:8000/polls/, I don't see the message “Hello, world. You’re at the polls index.” as expected. Instead, I get the following error:

Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order: ^admin/ The current URL, polls/, didn't match any of these.

Here is my mysite/urls.py file. I am not sure why the first regex pattern in urlpatterns is not recognized.

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),
]
1
whats in your polls.url i.e. /polls/urls.py - Bijoy
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.index, name='index'), ] - ddmj
check this link if it helps stackoverflow.com/questions/25716185/… - Bijoy
Yes that did help. Thank you! In mysite/settings.py, I changed the ROOT_URLCONF variable from 'mysite.urls' to 'urls'. - ddmj

1 Answers

-1
votes

You might have forgot .html extension in views.py while requesting the page.