views中获取form:
content = request.form('comment')
html文件是:
<div class="enter">
<form id="comment_form" name="comment" action="" method="POST" role="form">
<div>
<textarea id="comment" name="comment" class="form-control" rows="3"> </textarea>
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
</div>
错误提示是:
content = request.form('comment')
TypeError: 'ImmutableMultiDict' object is not callable
TypeError: 'ImmutableMultiDict' object is not callable,用错了,这个提示已经告诉你,form这个字典是不可调用
是request.form.get("comment");