pycharm 自动创建的 django project 时,运行却出现以下问题,求解?

2015-04-15 13:03:40 +08:00
 tooweakchen

E:\python27\python.exe "E:\pycharm\PyCharm 4.0.6\helpers\pydev\pydevd.py" --multiproc --client 127.0.0.1 --port 53449 --file D:/项目文件/ceshi/manage.py runserver
pydev debugger: process 2116 is connecting

Connected to pydev debugger (build 139.1659)
pydev debugger: process 1884 is connecting

Performing system checks...

System check identified no issues (0 silenced).
Unhandled exception in thread started by <pydev_monkey._NewThreadStartupWithTrace instance at 0x0000000003CA6CC8>
Traceback (most recent call last):
File "E:\pycharm\PyCharm 4.0.6\helpers\pydev\pydevmonkey.py", line 426, in __call_
return self.originalfunc(*self.args, **self.kwargs)
File "C:\Users\tooweak\AppData\Roaming\Python\Python27\site-packages\django\utils\autoreload.py", line 223, in wrapper
fn(*args, **kwargs)
File "C:\Users\tooweak\AppData\Roaming\Python\Python27\site-packages\django\core\management\commands\runserver.py", line 112, in inner_run
self.check_migrations()
File "C:\Users\tooweak\AppData\Roaming\Python\Python27\site-packages\django\core\management\commands\runserver.py", line 164, in check_migrations
executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
File "C:\Users\tooweak\AppData\Roaming\Python\Python27\site-packages\django\db\migrations\executor.py", line 19, in __init
_
self.loader = MigrationLoader(self.connection)
File "C:\Users\tooweak\AppData\Roaming\Python\Python27\site-packages\django\db\migrations\loader.py", line 47, in init
self.buildgraph()
File "C:\Users\tooweak\AppData\Roaming\Python\Python27\site-packages\django\db\migrations\loader.py", line 180, in build_graph
self.applied_migrations = recorder.applied_migrations()
File "C:\Users\tooweak\AppData\Roaming\Python\Python27\site-packages\django\db\migrations\recorder.py", line 59, in applied_migrations
self.ensure_schema()
File "C:\Users\tooweak\AppData\Roaming\Python\Python27\site-packages\django\db\migrations\recorder.py", line 49, in ensure_schema
if self.Migration._meta.db_table in self.connection.introspection.table_names(self.connection.cursor()):
File "C:\Users\tooweak\AppData\Roaming\Python\Python27\site-packages\django\db\backends\base\base.py", line 164, in cursor
cursor = self.make_debug_cursor(self._cursor())
File "C:\Users\tooweak\AppData\Roaming\Python\Python27\site-packages\django\db\backends\base\base.py", line 137, in _cursor
self.ensure_connection()
File "C:\Users\tooweak\AppData\Roaming\Python\Python27\site-packages\django\db\backends\base\base.py", line 132, in ensure_connection
self.connect()
File "C:\Users\tooweak\AppData\Roaming\Python\Python27\site-packages\django\db\utils.py", line 97, in __exit
_
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "C:\Users\tooweak\AppData\Roaming\Python\Python27\site-packages\django\db\backends\base\base.py", line 132, in ensure_connection
self.connect()
File "C:\Users\tooweak\AppData\Roaming\Python\Python27\site-packages\django\db\backends\base\base.py", line 121, in connect
self.connection = self.get_new_connection(conn_params)
File "C:\Users\tooweak\AppData\Roaming\Python\Python27\site-packages\django\db\backends\sqlite3\base.py", line 204, in get_new_connection
conn = Database.connect(**conn_params)
django.db.utils.OperationalError: unable to open database file

12263 次点击
所在节点    Python
4 条回复
cheerzeng
2015-04-15 14:07:27 +08:00
File "C:\Users\tooweak\AppData\Roaming\Python\Python27\site-packages\django\db\backends\sqlite3\base.py", line 204, in get_new_connection
conn = Database.connect(**conn_params)
django.db.utils.OperationalError: unable to open database file

是不是没有数据库文件?
tooweakchen
2015-04-15 20:28:33 +08:00
@cheerzeng 那怎么解决啊?我是新手,求巨巨告知
cheerzeng
2015-04-16 09:03:25 +08:00
把你的settings.py贴一下,看看里面数据库的设置,还有数据库文件的路径,你的django项目下面是否有对应的文件
gamexg
2015-04-16 10:34:59 +08:00
syncdb 了没?

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/183859

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX