标签:对象 home rem ret import def from html mes
from django.template import loader, Context def index(request): ...... t = loader.get_template("index.html") # 手动加载模板 c = Context( ‘app‘:‘app01‘, ‘user‘:request.user, ‘id_addr‘:request.META[‘REMOTE_ADDR‘] ‘message‘:‘index view‘ ) # 构建上下文对象 return t.render(c) # 渲染模板 def home(request): ...... t = loader.get_template("home.html") # 手动加载模板 c = Context( ‘app‘:‘app01‘, ‘user‘:request.user, ‘id_addr‘:request.META[‘REMOTE_ADDR‘] ‘message‘:‘home view‘ ) # 构建上下文对象 return t.render(c) # 渲染模板
标签:对象 home rem ret import def from html mes
原文地址:https://www.cnblogs.com/super-zhangkun/p/9951456.html