django复选框从html获取复选框值
html文件django复选框从html获取复选框值,django,Django,html文件 <form method="post"> {% csrf_token %} <table border="2" bordercolor="black" width="500" height="100" cellspacing="0" cellpadding="5"> <thead> <tr> <th>select
<form method="post">
{% csrf_token %}
<table border="2" bordercolor="black" width="500" height="100" cellspacing="0" cellpadding="5">
<thead>
<tr>
<th>selection</th>
<th>student name</th>
<th>e-mail</th>
<th>CV</th>
</tr>
</thead>
<tbody>
{% for ta in tas %}
<tr>
<td><input type="checkbox" name="checkbox_list" value="{{ ta.id }}"></td>
<td>{{ ta.user.first_name }} {{ ta.user.last_name }}</td>
<td>{{ ta.user.email }}</td>
<td><a href="{{ ta.cv.url }}">view cv</a></td>
</tr>
{% endfor %}
</tbody>
</table>
<button type="submit">next</button>
</form>
我的问题是,当我在html中单击submit按钮时,views.py中的ta_ranking类没有被调用。我如何解决这个问题?
谢谢你的帮助 表单中未包含视图的路径:
<form method="POST" action="/path/to/ta_ranking">
...
</form>
<form method="POST" action="/path/to/ta_ranking">
...
</form>
from django.urls import path
from myapp.views import ta_ranking
urlpatterns = [
path('/path/to/ta_ranking', ta_ranking),
]