Skip to content
Advertisement

No Django POST data when sent over a form?

I am on a development server (no CSRF protection), sending over login data to Django via a web form (Django: 127.0.0.1:8000). HTML:

JavaScript

Django:

JavaScript

I’m pretty sure that the POST data is not being transmitted (TypeError: unsupported operand type(s) for +: ‘NoneType’ and ‘str’) in the print statement, but I can’t figure out why. (The HTML is on localhost and the django is on 127.0.0.1:8000 as mentioned previously.) Is there any reason for this?

Advertisement

Answer

In request.POST you don’t have keys from id attribute, but from name. Add it to inputs and you’re fine.

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement