I am trying to fetch GET data receiving from an HTML form.
But it is giving me MultiValueDictError. It is also saying
During handling of the above exception, another exception occurred:
My HTML code :
<!DOCTYPE html>
<html>
<head>
<title>Document</title>
</head>
<body>
<form action="home_redirect/fd" id="redirect" method="POST" enctype="multipart/form-data">
{% csrf_token %}
<input type="text" value={{user}} name="user">
<input type="submit">
</form>
<script>
document.getElementById("redirect").submit()
</script>
</body>
</html>
My views.py :
def home(request):
user = request.POST['user']
return render(request, 'main.html', {'login': user})