Django-registration, force unique e-mail

前端 未结 7 1536
遇见更好的自我
遇见更好的自我 2020-12-03 14:32

Can I force users to make unique e-mail addresses in django-registration?

7条回答
  •  -上瘾入骨i
    2020-12-03 14:53

    It should suffice to create your registration form from your user model. If the e-mail address is defined to be unique there, the form will output an error on submit for duplicate addresses.

    Look here for details.

    As Dominic points out, you'll not be able to do this with the built-in user profile. You'll have to extend it by creating your own user profile as described here and make it contain a unique e-mail address.

提交回复
热议问题