美文网首页
执行python manage.py runserver时提示V

执行python manage.py runserver时提示V

作者: CoderZb | 来源:发表于2019-02-17 22:32 被阅读0次

    问题截图

    image.png
    Performing system checks...
    
    System check identified no issues (0 silenced).
    Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x10b726d90>
    Traceback (most recent call last):
      File "/Users/zhangbin/py_envs/dailyfresh/lib/python3.7/site-packages/django/db/migrations/loader.py", line 166, in check_key
        return self.graph.root_nodes(key[0])[0]
    IndexError: list index out of range
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/Users/zhangbin/py_envs/dailyfresh/lib/python3.7/site-packages/django/utils/autoreload.py", line 225, in wrapper
        fn(*args, **kwargs)
      File "/Users/zhangbin/py_envs/dailyfresh/lib/python3.7/site-packages/django/core/management/commands/runserver.py", line 120, in inner_run
        self.check_migrations()
      File "/Users/zhangbin/py_envs/dailyfresh/lib/python3.7/site-packages/django/core/management/base.py", line 442, in check_migrations
        executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
      File "/Users/zhangbin/py_envs/dailyfresh/lib/python3.7/site-packages/django/db/migrations/executor.py", line 18, in __init__
        self.loader = MigrationLoader(self.connection)
      File "/Users/zhangbin/py_envs/dailyfresh/lib/python3.7/site-packages/django/db/migrations/loader.py", line 49, in __init__
        self.build_graph()
      File "/Users/zhangbin/py_envs/dailyfresh/lib/python3.7/site-packages/django/db/migrations/loader.py", line 226, in build_graph
        self.add_external_dependencies(key, migration)
      File "/Users/zhangbin/py_envs/dailyfresh/lib/python3.7/site-packages/django/db/migrations/loader.py", line 191, in add_external_dependencies
        parent = self.check_key(parent, key[0])
      File "/Users/zhangbin/py_envs/dailyfresh/lib/python3.7/site-packages/django/db/migrations/loader.py", line 173, in check_key
        raise ValueError("Dependency on app with no migrations: %s" % key[0])
    ValueError: Dependency on app with no migrations: user
    
    

    原因;

    没有生成迁移文件导致的

    解决办法:

    执行python manage.py makemigrations命令

    image.png

    相关文章

      网友评论

          本文标题:执行python manage.py runserver时提示V

          本文链接:https://www.haomeiwen.com/subject/kowneqtx.html