django 创建超级用户时报错 1146
生活随笔
收集整理的这篇文章主要介绍了
django 创建超级用户时报错 1146
小编觉得挺不错的,现在分享给大家,帮大家做个参考.
前言
博主目前在使用django部署web服务,遇到了一些列问题,特此记录,方便自己和别人
目录
文章目录
- 前言
- 目录
- 描述
- 解决方法
描述
操作(创建超级用户):
python manage.py createsuperuser
报错内容:
django.db.utils.ProgrammingError: (1146, “Table ‘auth_user’ doesn’t exist”)
原因:
迁移同步时没有创建auth_user表。
解决方法
重新迁移同步,django会自动解决上述问题
python manage.py makemigrations No changes detected python manage.py migrate Operations to perform:Apply all migrations: TestModel, admin, auth, contenttypes, sessions Running migrations:Applying contenttypes.0001_initial... OKApplying auth.0001_initial... OKApplying admin.0001_initial... OKApplying admin.0002_logentry_remove_auto_add... OKApplying admin.0003_logentry_add_action_flag_choices... OKApplying contenttypes.0002_remove_content_type_name... OKApplying auth.0002_alter_permission_name_max_length... OKApplying auth.0003_alter_user_email_max_length... OKApplying auth.0004_alter_user_username_opts... OKApplying auth.0005_alter_user_last_login_null... OKApplying auth.0006_require_contenttypes_0002... OKApplying auth.0007_alter_validators_add_error_messages... OKApplying auth.0008_alter_user_username_max_length... OKApplying auth.0009_alter_user_last_name_max_length... OKApplying sessions.0001_initial... OK(exam2) D:\Anaconda\envs\exam2\Scripts\HelloWorld>python manage.py createsuperuser 用户名 (leave blank to use 'challenger'): 123总结
以上是生活随笔为你收集整理的django 创建超级用户时报错 1146的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: android封装方法js调用方法吗,c
- 下一篇: Vscode html代码快速填写