【发布时间】:2013-05-21 01:51:37
【问题描述】:
我有这个表格:
<form action="{% url create_question %}" method="post">
还有这个 url.py
url(r'^neues_thema/(\w+)/','home.views.create_question',name="create_question"),
但我收到此错误:
Reverse for 'create_question' with arguments '()'
and keyword arguments '{}' not found.
我做错了什么?
编辑:我要做的是:用户提交表单,我想获取用户正在创建的问题的标题并将其放入 url。然后 url 看起来像:neues_thema/how-to-make-bread/。如何在提交表单时动态将该参数提供给{% url create_question ??? %}
这个线程url template tag in django template 没有帮助我。
【问题讨论】:
-
哪个版本的 Django?
-
您希望在提交带有字段
question== "如何制作面包"的表单后将用户重定向到neues_thema/how-to-make-bread/? -
@imkost,是的,几乎,带有字段标题。