Django 我应该如何处理多值错误?

Django 我应该如何处理多值错误?,django,django-forms,Django,Django Forms,我正在为我的应用程序编写一个签出表单,但当我提交时,Django返回一个多值dictKeyError异常 Traceback: File "/home/mats-invasion/projects/f4l/env/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response 111. response = callback(request, *ca

我正在为我的应用程序编写一个签出表单,但当我提交时,Django返回一个
多值dictKeyError
异常

Traceback:
File "/home/mats-invasion/projects/f4l/env/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/home/mats-invasion/projects/f4l/f4l/live/views.py" in show_checkout
  33.           if postdata['submit'] == 'place_order':
File "/home/mats-invasion/projects/f4l/env/local/lib/python2.7/site-packages/django/utils/datastructures.py" in __getitem__
  258.             raise MultiValueDictKeyError("Key %r not found in %r" % (key, self))

Exception Type: MultiValueDictKeyError at /orders/checkout/
Exception Value: "Key 'submit' not found in <QueryDict: {u'delivery_address': [u'klab Telecom House,6th floor'], u'billing_address': [u'klab 6th telecom house'], u'billing_city': [u'kigza'], u'phone': [u'+2500855598432'], u'billing_name': [u'mar'], u'credit_card_type': [u'VISA'], u'credit_card_expire_month': [u'01'], u'credit_card_number': [u'4007000000027'], u'delivery_name': [u'mar'], u'credit_card_cvv': [u'567'], u'credit_card_expire_year': [u'2016'], u'csrfmiddlewaretoken': [u'UGu4G75x2CxPFfnUdGSnVZzueedNxtu6'], u'delivery_city': [u'kigali'], u'email': [u'marxmass@gmail.com']}>"
这是a在我的模板中所做的

<input type="submit" value="Place order" class="submit" />


感谢您的帮助。

将您的提交输入更改为名称为
submit
,否则它将不会进入post数据

<input type="submit" value="Place order" class="submit" name="submit" />


此外,该值将是
'placeorder'
,而不是
'Place\u order'

将提交输入更改为名称为
submit
,否则它将不会进入post数据

<input type="submit" value="Place order" class="submit" name="submit" />


此外,值将是
'placeorder'
,而不是
'Place\u order'

您是否尝试过编写准确的html提交值:
value=“Place\u order”
?您是否尝试过编写准确的html提交值:
value=“Place\u order”