一: 报错内容: django.db.utils.IntegrityError: (1062, "Duplicate entry '' for key 'mobile'") 二: 出错原因: 因为之前创建的超级用户的mobile字段没有设置,是空的。而这次再次设置就会跟之前的重复了。 三: 解决方案: 将之前的超级用户的mobile添加数据,再次使用命令。
django.db.utils.IntegrityError: (1062, "Duplicate entry '' for key 'mobile'")
python3 manage.py createsuperuser
博客园 © 2004-2025 浙公网安备 33010602011771号 浙ICP备2021040463号-3