Py学习  »  问与答

小菜Django刚开始卡在这里了,老司机带飞

Macon • 9 年前 • 4644 次点击  

开始了一个测试的app

执行runserver 命令的时候报错:

# python manage.py runserver

Performing system checks...

System check identified no issues (0 silenced).
Unhandled exception in thread started by <function wrapper at 0x2b4349afecf8>
Traceback (most recent call last):
  File "/usr/local/python27/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/utils/autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)
  File "/usr/local/python27/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/core/management/commands/runserver.py", line 117, in inner_run
    self.check_migrations()
  File "/usr/local/python27/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/core/management/commands/runserver.py", line 163, in check_migrations
    executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
  File "/usr/local/python27/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/db/migrations/executor.py", line 20, in __init__
    self.loader = MigrationLoader(self.connection)
  File "/usr/local/python27/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/db/migrations/loader.py", line 49, in __init__
    self.build_graph()
  File "/usr/local/python27/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/db/migrations/loader.py", line 176, in build_graph
    self.applied_migrations = recorder.applied_migrations()
  File "/usr/local/python27/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/db/migrations/recorder.py", line 65, in applied_migrations
    self.ensure_schema()
  File "/usr/local/python27/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/db/migrations/recorder.py", line 56, in ensure_schema
    with self.connection.schema_editor() as editor:
  File "/usr/local/python27/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/db/backends/sqlite3/schema.py", line 25, in __enter__
    self._initial_pragma_fk = c.fetchone()[0]
TypeError: 'NoneType' object has no attribute '__getitem__'
Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/1597
 
4644 次点击  
文章 [ 4 ]  |  最新文章 9 年前