Tom,
- You shouldn't use Model=User (or the Meta) as it was a ModelForm, it is
just a regular Form
- AuthenticationForm takes request as its first parameter:
def login_register(request, template="templates/login_register.html"):
if request.method == "POST":
login_form = AuthenticationForm(request, data=request.POST)
if login_form.is_valid():
print("Login form valid")
# return redirect(home_slug())
# else:
# print "Login invalid"
else:
login_form = AuthenticationForm()
return render(request, template, {"login_form": login_form})
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/CA%2BFDnh%2B1i4eRye6qr%3DF2zWz2Nnf4mAZ1%3DnY357m01HSyeFL0UA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.