空路径与这些 URL 中的任何一个都不匹配

The empty path didn't match any of these URLs

使用 first_project.urls 中定义的 URLconf,Django 尝试了这些 URL 模式,顺序为:

^$ [name='index']
admin/

空路径与其中任何一个都不匹配。

这是 urls.py

中的代码
from django.contrib import admin
from django.urls import path
from first_app import views
urlpatterns = [
    path('^$',views.index,name='index'),
    path('admin/', admin.site.urls),

path() should not have regex characters in it, you are confusing it with url()/re_path()语法

path('',views.index,name='index')