django 创建超级用户时报错 1146
生活随笔
收集整理的這篇文章主要介紹了
django 创建超级用户时报错 1146
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
前言
博主目前在使用django部署web服務(wù),遇到了一些列問題,特此記錄,方便自己和別人
目錄
文章目錄
- 前言
- 目錄
- 描述
- 解決方法
描述
操作(創(chuàng)建超級用戶):
python manage.py createsuperuser
報(bào)錯(cuò)內(nèi)容:
django.db.utils.ProgrammingError: (1146, “Table ‘a(chǎn)uth_user’ doesn’t exist”)
原因:
遷移同步時(shí)沒有創(chuàng)建auth_user表。
解決方法
重新遷移同步,django會(huì)自動(dòng)解決上述問題
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總結(jié)
以上是生活随笔為你收集整理的django 创建超级用户时报错 1146的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: android封装方法js调用方法吗,c
- 下一篇: 虚拟机机操作系统已禁用 cpu。请关闭或