在我的Django項目,當我訪問本地主機:8000,它說:頁面未使用Django發現(404)
Page not found (404)
Request Method: GET
Request URL: http://localhost:8000/
的urls.py是:
from django.conf.urls import include, url
from django.contrib import admin
from polls import views
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^polls/', include('polls.urls', namespace="polls")),
]
民意調查的urls.py是:
from django.conf.urls import url, include
from django.contrib import admin
from polls import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^(?P<question_id>\d+)/$', views.detail, name='detail'),
url(r'^(?P<question_id>\d+)/vote/$', views.vote, name='vote'),
url(r'^(?P<question_id>\d+)/results/$', views.results, name='results'),
url(r'^admin/', admin.site.urls),
]
Django版本是1.10。任何人都可以幫我找出問題嗎?提前致謝。