I'm beginning to learn web development with Django and I've run into a problem, I have a form :
from django import forms
from .models import film
class searchFilm(forms.Form):
FilmName = forms.Field()
and in my views file I try to print the search term:
print request.POST["FilmName"]
but I get the error:
raise MultiValueDictKeyError(repr(key))
MultiValueDictKeyError: "'FilmName'"
if I just print the whole thing I get the output:
<QueryDict: {u'csrfmiddlewaretoken': [u'************'], u'FilmName': [u'hellowe']}>
And I'm not sure why, how do I just print the search term?