Django 1.7中用户名较长 [英] Longer username in Django 1.7
问题描述
这是为Django 1.2。
有没有人尝试类似的黑客Django> 1.5
提前感谢
自定义用户模型是一个巨大的变化,并不总是与应用程序兼容。我通过运行这个非常务实的移民来解决这个问题。注意这只能在数据库级别解决。
migrations.RunSQL(alter table auth_user alter column username type varchar(254);)
I want to increase the length of the username in django from 30 to around 80, I know it may be duplicate question but the previous answers are not working, for example https://kfalck.net/2010/12/30/longer-usernames-for-django
this is for Django 1.2.
Did anyone try similar hack for Django>1.5 Thanks in advance
Custom User Models are a huge change to make and aren't always compatible with apps. I solved it by running this very pragmatic migration. Note this only solves it at the database level.
migrations.RunSQL("alter table auth_user alter column username type varchar(254);")
这篇关于Django 1.7中用户名较长的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!