Django使用URLconf
中定义的pccb_model.urls
,Django按以下顺序尝试了这些URL模式:
predictive/
admin/
空路径与任何这些都不匹配。
答案 0 :(得分:1)
是的,您需要在 pccb_model.urls 模块中为默认路径定义一个视图。确保 views.py 中有相应的方法。例如:
urls.py
path('', views.index)
views.py
def index(request):
return HttpResponse('test', status=200)