I\'m trying to save a object to my database, but it\'s throwing a MultiValueDictKeyError
error.
The problems lies within the form, the is_private<
Another thing to remember is that request.POST['keyword']
refers to the element identified by the specified html name
attribute keyword
.
So, if your form is:
<form action="/login/" method="POST">
<input type="text" name="keyword" placeholder="Search query">
<input type="number" name="results" placeholder="Number of results">
</form>
then, request.POST['keyword']
and request.POST['results']
will contain the value of the input elements keyword
and results
, respectively.