1、模板是一个文本,用于分离文档的表现形式和内容。也可以说是:HTML代码+模板语法

     简单的例子:使用模板在页面显示“hello word”     

      在template中新建html文件:hello.html,  在views.py中添加对象,向模板中提交数据。在urls.py中添加url与函数对象的映射关系

<h1>{{ hello }}</h1>
hello.html

相关文章:

  • 2021-07-02
  • 2021-08-07
  • 2022-12-23
  • 2021-10-12
  • 2022-12-23
  • 2021-07-03
  • 2022-03-01
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-18
  • 2022-02-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案