Py学习  »  问与答

django中有没有一种"include view"视图的方法?

ziozio • 9 年前 • 7352 次点击  

假设视图view_A的模块example_A.html 引入了example_B.html的代码( {% include 'example_B.html' %} )

这样这引入了example_B.html的html代码, 即view_A中不存在view_B的数据(Context).

问: 是需要每次都要把example_B.html中出现过的数据(Context)重新输入一次吗? 有没有一种方法直接引入view_B和example_B.html的?

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/639
 
7352 次点击  
文章 [ 7 ]  |  最新文章 9 年前