我的代码一直在工作,直到我为页眉和页脚创建了base.html模板。我取消了对项目的大部分更改并重新运行服务器,但仍在网页上显示此错误:
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('',include('Website.urls')),
]
```Page not found (404)
Request Method: GET
Request URL: http://localhost:8000/
Using the URLconf defined in DIALYSIS.urls, Django tried these URL patterns, in this order:
admin/
Home.html [name='Home']
contact.html [name='contact']
The empty path 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.
终端给出此错误:
System check identified no issues (0 silenced).
June 16, 2020 - 09:22:12
Django version 3.0.7, using settings 'DIALYSIS.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
Watching for file changes with StatReloader
Not Found: /
[16/Jun/2020 09:26:57] "GET / HTTP/1.1" 404 2267
C:\DialysisCenter\DIALYSIS\DIALYSIS\settings.py changed, reloading.
Performing system checks...
System check identified no issues (0 silenced).
June 16, 2020 - 09:25:29
Django version 3.0.7, using settings 'DIALYSIS.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
Watching for file changes with StatReloader
Not Found: /
[16/Jun/2020 09:29:40] "GET / HTTP/1.1" 404 2267
Not Found: /
[16/Jun/2020 09:29:41] "GET / HTTP/1.1" 404 2267
Not Found: /
[16/Jun/2020 09:29:46] "GET / HTTP/1.1" 404 2267
Performing system checks...
System check identified no issues (0 silenced).
June 16, 2020 - 09:29:39
Django version 3.0.7, using settings 'DIALYSIS.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
(virtual)
这是我的URL.py代码
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('',include('Website.urls')),
]
目前没有回答
相关问题 更多 >
编程相关推荐