我目前被困在 django 教程的第 3 部分。民意调查views.py是...
from django.http import HttpResponse
def index(request):
return HttpResponse("<strong>Welcome to the poll index page!</strong>")
民意调查网址是...
from django.conf.urls import patterns, url
from polls import views
urlpatterns = patterns('',
url(r'^$', views.index, name='index')
)
我的网站网址是...
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^polls/', include('polls.urls')),
url(r'^admin/', include(admin.site.urls)),
)
每次我运行它,我都会得到......
Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order:
^polls/
^admin/
The current URL, , didn't match any of these.
似乎无法弄清楚这里出了什么问题,有什么提示吗?