Form not validating django

Edit: It's probably worth noting that it did work in the past.

I'm not certain when it stopped, but I remember it working before I started playing around with django-filter.

Maybe for an entirely different reason, but I got rid of it.

From now on I'll still be referring to the first example.

I got the idea from the second answer to this question.

Unfortunately (but also kind of fortunately), it didn't work.

import models def login(request): username = "not logged in" if request. Password Input()) # METHOD TO VERIFY IF USER IS IN DB def clean_message(self): username = self.cleaned_data.get("username") dbuser = Dreamreal.objects.filter(name = 'username') if not dbuser: raise forms. ") return username from import models class Dreamreal(models.

The form consists simply of firstname and lastname.I've checked the POST data being sent when I submit the form, using Chrome's developer console, and it's sending it using the format that I want.And when pre-populated, the value already there is correct, too.Firstname is required, and for testing purposes I check if lastname is Smith and raise an exception.When I violate those requirements nothing happens, i.e.