[Django]-'WSGIRequest' object has no attribute 'get' when executing form.is_valid()

10👍

I think you need to do

form = CourseSelectionForm(request.POST)

1👍

Look at this line return data.get(name) from your traceback(second last), at which this error occurred. It is trying to get name from request and request has no attribute get.
You need to pass requested data to your modelform.
Try this:

form = CourseSelectionForm(request.POST)

for more clarification read this:
https://docs.djangoproject.com/en/2.0/topics/forms/modelforms/
https://docs.djangoproject.com/en/2.0/topics/forms/

👤Diksha

Leave a comment