我按照the tutorial中的说明操作
我做了一个调试更改,文件如下:
我的网站1\网址.py公司名称:
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^abc/', include('polls.urls')),
url(r'^polls/', admin.site.urls),
url(r'^admin/', admin.site.urls),
]
文件:mysite1\polls\网址.py在
^{pr2}$现在如果我转到站点http://127.0.0.1:8000/polls/
,那么它显示的登录页面与转到站点http://127.0.0.1:8000/admin/
相同。在
但是,如果我访问站点http://127.0.0.1:8000/abc/
,它会给出以下信息:
Page not found (404)
Request Method: GET
Request URL: http://127.0.0.1:8000/abc
Using the URLconf defined in mysite1.urls, Django tried these URL patterns, in this order:
^abc/
^polls/
^admin/
The current URL, abc, didn't match any of these.
You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.
有人能告诉我我做错了什么吗?在
在
mysite1\polls\urls.py
中应该是请注意,您的代码有一个}。
&
,而不是{$
表示字符串匹配字符的结尾。在相关问题 更多 >
编程相关推荐