views中返回return template的函数
以下是本文的主要内容
一、HttpResponse(str)
from django.urls import HttpResponse
二、render(request,template的path)
from django.shortcuts import render
三、redirect(spacename:name)重定向
from django.shortcuts import redirect
四、reverse(urls中的name)
from django.urls import reverse
解析别名的连结,把urls中的name解析为命名
注:他只是解析name,而不能在views中返回页面,与redirect连用
五、 HttpResponseRedirect(name)
它的功能与redirect一般,redirect是HttpResponseRedirect的缩写,所以都用缩写redirect