django 创建视图和APP

时间:2023-12-24 16:28:01
.创建视图views
1.在项目目录下创建views.py文件
2.from django.http import HttpResponse
3.在urls 导入模板: from django.contrib import admin
from django.urls import path
from . import views 4。修改路由: path('index/', views.index) .创建APP
1.在项目命令下创建:python manage.py startapp teacher
2.选择创建的APP download from here