1、模版的执行

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

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

相关文章:

  • 2021-12-20
  • 2021-06-11
  • 2021-07-18
  • 2021-05-26
  • 2022-12-23
猜你喜欢
  • 2021-08-07
  • 2021-07-07
  • 2021-12-05
  • 2021-10-12
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案