标签:tin path site 服务器 shortcut sql request 文件配置 编辑
test6/urls.py
from django.contrib import admin from django.urls import path, re_path, include urlpatterns = [ path(‘admin/‘, admin.site.urls), re_path(r‘^$‘, include(‘school.urls‘)) ]
school/urls.py from django.urls import re_path from school import views urlpatterns = [ re_path(r‘^index$‘, views.index), ]
from django.shortcuts import render def index(request): return render(request, ‘school/index.html‘)
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>首页</title> </head> <body> <h1>congratulations</h1> </body> </html>
标签:tin path site 服务器 shortcut sql request 文件配置 编辑
原文地址:https://www.cnblogs.com/Hannibal-2018/p/11122387.html