I\'m going to get parameter form AJAX request in Django, Here\'s what I\'m doing:
base.html:
What's happening is that you haven't prevented the browser's default submit
action from taking place. So your Ajax POST is done, but then immediately the browser itself POSTs - and, as Michal points out, your form doesn't include a name
field, so the lookup fails.
You need to do two things to fix this. Firstly, use e.preventDefault();
in your JS click method. Secondly, check for request.is_ajax()
at the top of your view.