Python Django基础:4.5映射。。。找不到页面(404)
请原谅,我是Django和Python的新手 我正在学习“Django基础知识”教程() 我已经完成了4.5映射部分,下面是我的代码,与站点的教程代码相同:Python Django基础:4.5映射。。。找不到页面(404),python,django,http-status-code-404,Python,Django,Http Status Code 404,请原谅,我是Django和Python的新手 我正在学习“Django基础知识”教程() 我已经完成了4.5映射部分,下面是我的代码,与站点的教程代码相同: from django.conf.urls import include, url, patterns from django.contrib import admin urlpatterns = patterns('', # Examples: # url(r'^$', 'tango_with_django_project_17.vie
from django.conf.urls import include, url, patterns
from django.contrib import admin
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'tango_with_django_project_17.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^rango/', include('rango.urls')), # ADD THIS NEW TUPLE!
)
最后,我以127.0.0.1.8000运行服务器,并得到错误:
Page not found (404)
Using the URLconf defined in tango_with_django_project.urls, Django tried these
URL patterns, in this order:
^admin/
^rango/
The current URL, , didn't match any of these.
起初,我必须导入“模式”以阻止名称错误,但现在我的页面根本不会显示。有人知道我哪里出错了吗
我正在使用:
Django 1.8(www.tangowithdjango.com使用1.7,我应该改成这个吗?)
Python 2.7.5您没有阅读本节的其余部分: 重新启动Django开发服务器并访问
http://127.0.0.1:8000/rango