Can I change Django's auth_user.username field to be 100 chars long without breaking anything?

前端 未结 7 1500
眼角桃花
眼角桃花 2021-02-06 05:31

Before somebody marks this question as a duplicate of this question Can django\'s auth_user.username be varchar(75)? How could that be done? or other such questions on SO, pleas

7条回答
  •  南方客
    南方客 (楼主)
    2021-02-06 06:08

    Another solution is to change your authentication code. When a new user signs up, they enter an email, you save this in the email field so you have it, and if their email is >30 characters, you shorten it before putting it into the user field. Then, change your login authentication for new logins.

提交回复
热议问题