Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/cmake/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
django复选框从html获取复选框值_Django - Fatal编程技术网

django复选框从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

html文件

<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 }}&nbsp;{{ 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),
]