app目录下创建urls.py
from django.urls import path
from . import views
urlpatterns = [
path('index/', views.index, name='首页'),
]
主目录下的urls.py
include app目录下的所有urls
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('school_info.urls')),
]