多个app url路由分发
project下url设置
urlpatterns = [
path('zong/',include('mysite.urls')),
path('zong/', include('myapp.urls')),
]
myapp 下urls设置(在app新建urls.py文件)
urlpatterns = [
path('myapp/login/',views.login)
]
myapp 下views设置
def index(request): return HttpResponse("login")
mysite 下urls设置(在app新建urls.py文件)
urlpatterns = [ path('mysite/index/',views.index) ]
mysite 下views设置
def index(request): return HttpResponse("index")
页面