使用django在做添加superuser操作时报错\xBA\xA3像是乱码,djangosuperuser,每次用manage.py


每次用

manage.py createsuper

都会报下面这个错误
Warning: Incorrect string value: '\xBA\xA3' for column 'username' at row 1

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

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

编橙之家文章,

评论关闭