日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

django 创建超级用户时报错 1146

發布時間:2025/3/15 编程问答 15 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。