1👍
✅
Why would you do this in post
? Use form_valid
method instead:
def form_valid(self, form):
username = form.cleaned_data.get("username")
if username:
print(username)
return HttpResponseRedirect(self.get_success_url())
Source:stackexchange.com