django添加superuser出错


每次用

manage.py createsuper


都会报下面这个错误

Warning: Incorrect string value: '\xBA\xA3' for column 'username' at row 1

看起来貌似是中文乱码的问题,应该怎么解决?跟数据库有关吗?

相关链接

python django

专食葱的人 12 years, 4 months ago

没记错的话,django.contrib.auth.models 中的User.username是不支持中文的。网上有解决办法,可以goole一下,但去改源码,这是不妥的。

猩猩三点灯 answered 12 years, 4 months ago

Your Answer