RequestContext loader
from django.template import loader,RequestContext
#1加载模板文件
temp = loader.get_template("index.html")
# 2 定义模板上下文
context = RequestContext()
#渲染
res_html = remp.render(context)
return HttpResponse(res_html)
from django.template import loader,RequestContext
#1加载模板文件
temp = loader.get_template("index.html")
# 2 定义模板上下文
context = RequestContext()
#渲染
res_html = remp.render(context)
return HttpResponse(res_html)