Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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),
]
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
524 views
Welcome To Ask or Share your Answers For Others

1 Answer

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...