在 book_list.html 的页面下方加上 “添加作者” 的链接
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>作者列表</title>
</head>
<body>
<h1>作者列表</h1>
<table border="1">
<thead>
<tr>
<th>#</th>
<th>id</th>
<th>名字</th>
<th>书籍</th>
</tr>
</thead>
<tbody>
{% for author in author_list %}
<tr>
<td>{{ forloop.counter }}</td>
<td>{{ author.id }}</td>
<td>{{ author.name }}</td>
<td>
{% for book in author.book.all %}
{% if forloop.last %}
{{ book.title }}
{% else %}
{{ book.title }} |
{% endif %}
{% endfor %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
<a href="/go.html?url=/add_author/">添加书籍</a>
</body>
</html>
<!DOCT