为了账号安全,请及时绑定邮箱和手机立即绑定

打完Python manage.py createsuperuser后出现这个怎么回事

You have 13 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.

Run 'python manage.py migrate' to apply them.

Traceback (most recent call last):

  File "C:\Python\Python36\lib\site-packages\django\db\backends\utils.py", line 64, in execute

    return self.cursor.execute(sql, params)

  File "C:\Python\Python36\lib\site-packages\django\db\backends\mysql\base.py", line 110, in execute

    return self.cursor.execute(query, args)

  File "C:\Python\Python36\lib\site-packages\MySQLdb\cursors.py", line 250, in execute

    self.errorhandler(self, exc, value)

  File "C:\Python\Python36\lib\site-packages\MySQLdb\connections.py", line 50, in defaulterrorhandler

    raise errorvalue

  File "C:\Python\Python36\lib\site-packages\MySQLdb\cursors.py", line 247, in execute

    res = self._query(query)

  File "C:\Python\Python36\lib\site-packages\MySQLdb\cursors.py", line 411, in _query

    rowcount = self._do_query(q)

  File "C:\Python\Python36\lib\site-packages\MySQLdb\cursors.py", line 374, in _do_query

    db.query(q)

  File "C:\Python\Python36\lib\site-packages\MySQLdb\connections.py", line 277, in query

    _mysql.connection.query(self, query)

_mysql_exceptions.ProgrammingError: (1146, "Table 'db_mysql.auth_user' doesn't exist")


The above exception was the direct cause of the following exception:


Traceback (most recent call last):

  File "manage.py", line 22, in <module>

    execute_from_command_line(sys.argv)

  File "C:\Python\Python36\lib\site-packages\django\core\management\__init__.py", line 367, in execute_from_command_line

    utility.execute()

  File "C:\Python\Python36\lib\site-packages\django\core\management\__init__.py", line 359, in execute

    self.fetch_command(subcommand).run_from_argv(self.argv)

  File "C:\Python\Python36\lib\site-packages\django\core\management\base.py", line 294, in run_from_argv

    self.execute(*args, **cmd_options)

  File "C:\Python\Python36\lib\site-packages\django\contrib\auth\management\commands\createsuperuser.py", line 63, in execute

    return super(Command, self).execute(*args, **options)

  File "C:\Python\Python36\lib\site-packages\django\core\management\base.py", line 345, in execute

    output = self.handle(*args, **options)

  File "C:\Python\Python36\lib\site-packages\django\contrib\auth\management\commands\createsuperuser.py", line 96, in handle

    default_username = get_default_username()

  File "C:\Python\Python36\lib\site-packages\django\contrib\auth\management\__init__.py", line 148, in get_default_username

    auth_app.User._default_manager.get(username=default_username)

  File "C:\Python\Python36\lib\site-packages\django\db\models\manager.py", line 85, in manager_method

    return getattr(self.get_queryset(), name)(*args, **kwargs)

  File "C:\Python\Python36\lib\site-packages\django\db\models\query.py", line 379, in get

    num = len(clone)

  File "C:\Python\Python36\lib\site-packages\django\db\models\query.py", line 238, in __len__

    self._fetch_all()

  File "C:\Python\Python36\lib\site-packages\django\db\models\query.py", line 1087, in _fetch_all

    self._result_cache = list(self.iterator())

  File "C:\Python\Python36\lib\site-packages\django\db\models\query.py", line 54, in __iter__

    results = compiler.execute_sql()

  File "C:\Python\Python36\lib\site-packages\django\db\models\sql\compiler.py", line 835, in execute_sql

    cursor.execute(sql, params)

  File "C:\Python\Python36\lib\site-packages\django\db\backends\utils.py", line 79, in execute

    return super(CursorDebugWrapper, self).execute(sql, params)

  File "C:\Python\Python36\lib\site-packages\django\db\backends\utils.py", line 64, in execute

    return self.cursor.execute(sql, params)

  File "C:\Python\Python36\lib\site-packages\django\db\utils.py", line 94, in __exit__

    six.reraise(dj_exc_type, dj_exc_value, traceback)

  File "C:\Python\Python36\lib\site-packages\django\utils\six.py", line 685, in reraise

    raise value.with_traceback(tb)

  File "C:\Python\Python36\lib\site-packages\django\db\backends\utils.py", line 64, in execute

    return self.cursor.execute(sql, params)

  File "C:\Python\Python36\lib\site-packages\django\db\backends\mysql\base.py", line 110, in execute

    return self.cursor.execute(query, args)

  File "C:\Python\Python36\lib\site-packages\MySQLdb\cursors.py", line 250, in execute

    self.errorhandler(self, exc, value)

  File "C:\Python\Python36\lib\site-packages\MySQLdb\connections.py", line 50, in defaulterrorhandler

    raise errorvalue

  File "C:\Python\Python36\lib\site-packages\MySQLdb\cursors.py", line 247, in execute

    res = self._query(query)

  File "C:\Python\Python36\lib\site-packages\MySQLdb\cursors.py", line 411, in _query

    rowcount = self._do_query(q)

  File "C:\Python\Python36\lib\site-packages\MySQLdb\cursors.py", line 374, in _do_query

    db.query(q)

  File "C:\Python\Python36\lib\site-packages\MySQLdb\connections.py", line 277, in query

    _mysql.connection.query(self, query)

django.db.utils.ProgrammingError: (1146, "Table 'db_mysql.auth_user' doesn't exist")


正在回答

2 回答

    raise KeyError("Unknown language code %s." % lang_code)

KeyError: u'Unknown language code .'

[20/Jun/2018 20:00:17] "GET /xadmin/ HTTP/1.1" 500 301209

老师报这个错误,能帮我看看 吗 

0 回复 有任何疑惑可以回复我~

在命令行中输入:python manage.py makemigrations

                          python manage.py migrate

1 回复 有任何疑惑可以回复我~
#1

Queen宣 提问者

谢谢,好使了
2018-04-01 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
django入门与实践
  • 参与学习       65127    人
  • 解答问题       898    个

手把手带你进入Django开发的大门,充分领略Django的魅力

进入课程

打完Python manage.py createsuperuser后出现这个怎么回事

我要回答 关注问题
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号