模板menu.html:
<h2>用户信息管理</h2> <a href="{% url 'indexusers' %}">浏览信息</a>| <a href="{% url 'adduser' %}">添加信息</a> <hr/>
文件index.html引用menu.html如下(部分代码):
{% include "myapp/users/menu.html" %}#此句为引用menu.html文件 <table width="800" border="1"> <tr> <th>ID号</th> <th>姓名</th> <th>年龄</th> <th>电话</th> <th>添加时间</th> <th>操作</th> </tr>
效果如下: