V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
tooweakchen
V2EX  ›  Python

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

  •  
  •   tooweakchen · 2015-04-15 13:03:40 +08:00 · 12147 次点击
    这是一个创建于 3296 天前的主题,其中的信息可能已经有所发展或是发生改变。

    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

    4 条回复
    cheerzeng
        1
    cheerzeng  
       2015-04-15 14:07:27 +08:00   ❤️ 1
    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
        2
    tooweakchen  
    OP
       2015-04-15 20:28:33 +08:00
    @cheerzeng 那怎么解决啊?我是新手,求巨巨告知
    cheerzeng
        3
    cheerzeng  
       2015-04-16 09:03:25 +08:00 via Android
    把你的settings.py贴一下,看看里面数据库的设置,还有数据库文件的路径,你的django项目下面是否有对应的文件
    gamexg
        4
    gamexg  
       2015-04-16 10:34:59 +08:00
    syncdb 了没?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1140 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 22:47 · PVG 06:47 · LAX 15:47 · JFK 18:47
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.