首页 > django添加superuser出错

django添加superuser出错

每次用

manage.py createsuper

都会报下面这个错误

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

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


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

【热门文章】
【热门文章】