[Answer]-Acces html form fields inside django view with request objects

1👍

request.POST is a dict. So, you can’t access the keys of request.POST as you can do with the attributes of an object.

A simple solution to your problem can be:

name = request.POST.get('name')

So, name will either be the value passed in the form or None.

0👍

You can’t. id property is not passed in the request.

You should use the name="some_name" attribute of the html input. And it will be available as request.POST['some_name'].

Leave a comment