Extending UserCreationForm to include email, first name, and last name

后端 未结 1 466
悲&欢浪女
悲&欢浪女 2021-01-03 08:28

I\'ve been stuck on this for a while now and can\'t seem to figure out what\'s going on. I\'m just starting to learn Django and I got my login set up and now want to impleme

相关标签:
1条回答
  • 2021-01-03 08:38

    My guess is that your meta class fields doesn't include username.

    You are inheriting the form field from UserCreationForm but it's not saving to the User model and therefore authenticate is failing, and crashing on login()

    The docs suggest you check whether authenticate() is successful before using login()

    0 讨论(0)
提交回复
热议问题