django - Registration Form with only email + password -
i want registration form email + password. thinking insert automatically email in username field. so, eash user, have this:
username: example@example.com
password: mypassword
email: example@example.com
of course email + password used in login process.
is solution having 2 fields same value ? or there more sofisticated solution ?
thanks :)
probably not idea circumvent the expected regex validation on username
r'^\w+$'
(so no @
or .
, obviously). also, there's 30 character limit on username
, lots of email addresses won't fit.
you should write custom auth backend authenticates based on actual email field - many people this, can find samples on djangosnippets.
two things keep in mind - default, email field non-unique. also, going break admin app, you'll need jiggery pokery if want use contrib.admin.
Comments
Post a Comment