模板

1、模版的执行

模版的创建过程,对于模版,其实就是读取模版(其中嵌套着模版标签),然后将 Model 中获取的数据插入到模版中,最后将信息返回给用户。

def current_datetime(request):
    now = datetime.datetime.now()
    html = "<html><body>It is now %s.</body></html>" % now
    return HttpResponse(html)
View Code

相关文章:

  • 2021-08-11
  • 2021-07-05
  • 2022-12-23
猜你喜欢
  • 2022-01-29
  • 2021-08-17
  • 2022-12-29
  • 2022-02-08
  • 2021-12-04
相关资源
相似解决方案