一:创建模版文件夹

二:配置模版目录


三:使用模版文件

四:给模版文件传递数据
模版变量使用:{{ 模版变量名 }}
模版代码段:{ % 代码 % }
for 循环:
{ % for I in list % }
{ % endear % }

五:浏览器显示结果

模版变量使用:{{ 模版变量名 }}
模版代码段:{ % 代码 % }
for 循环:
{ % for I in list % }
{ % endear % }
本文标题:三十二:Django之模版使用
本文链接:https://www.haomeiwen.com/subject/vyfzfktx.html
网友评论