表单和模版

mac2022-06-30  96

模版解决重复的代码,节约时间

模板文件

<br>this is tornado templates include<br>子模板 {% include "05include.html" %}

include

{% include "filename" %}

include 可以导入一些其他的模块文件,一般使用include的时候,模板文件中不使用block块

导入内置模块

<br>{% import time %}{{ time.time()}}导入自定义模块 <br>{% from mod_file i,port add, upper,Calculation %}{{add(5,6)}}form表单 <form action="/temp" enctype="multipart/form-data" method="post"> <input type="text" name="username" /> <input type="text" name="age" /> <input type="submit" /></form>application配置增加/temp路由

 

转载于:https://www.cnblogs.com/wdty/p/10784748.html

最新回复(0)