【发布时间】:2020-12-22 13:26:49
【问题描述】:
我想通过单击 html 按钮来调用视图函数 resign_game。这是我在阅读了一些 Stackoverflow 帖子后尝试过的:
<form action="{% url 'resign_game' %}" method="POST">
<button type="button">RESIGN</button>
</form>
这是我的 urls.py 中的内容:
path('resign_game/', views.resign_current_game, name='resign_game')
但是,在我单击按钮后,视图函数从未被调用。我会很感激你的建议。谢谢!
【问题讨论】:
-
and whats in your views.py ?