-2
這裏是我的模板:如何在Python/Django中調試MultiValueDictKeyError?
<form name="myMessage" onsubmit="return validateFormMessage()" method="post" class="signin" action="/profile/message_page">{% csrf_token %}
<div class="title-dl">{% trans "Compose Message" %}</div>
<div class="dear message_dialog">
<div><label>{% trans "To" %}</label><input id="to_user" type="text" class="form-control" name = "user_send" />
</div>
<div><label>{% trans "Title" %}</label><input type="text" id ="title" class="form-control" name = "title_message"/></div>
</div>
<div class="dl_coin">
<div class="coin-first"><label>{% trans "Content" %} </label></div>
<div class="content-message">
<textarea class="form-control" id="content-message" style="width: 98%;height: 153px;" name="content-message"></textarea>
</div>
</div>
<div class = "fileAttach">
<i></i><input type = "file" name = "fileAttach">
</div>
<div>
<input type="submit" class="btn btn-success dl-submit" value="Send">
</div>
</form>
上view.py
我用:
fileAttach = request.FILES['fileAttach']
,但我得到的錯誤MultiValueDictKeyError。我該如何解決它?
請參閱[如何寫出一個好標題](http://stackoverflow.com/help/how-to-ask) – Arc676
這是「Django」嗎? – Matthias
是的!你可以幫幫我嗎!! –