我在django的sqlite3有問題。這是我第一次使用這個。「無法打開數據庫文件」在django
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': '/home/djangobook/mydb.db',
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': '',
}
}
錯誤:
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/__init__.py", line 324, in cursor
cursor = self.make_debug_cursor(self._cursor())
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/sqlite3/base.py", line 306, in _cursor
self._sqlite_create_connection()
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/sqlite3/base.py", line 296, in _sqlite_create_connection
self.connection = Database.connect(**kwargs)
OperationalError: unable to open database file
感謝您的幫助。
您是否已經運行過syncdb? –
嗨,親愛的。不,這是什麼? – user1788781
你是以用戶djangobook身份運行嗎?你有寫訪問給定的路徑嗎? – sk1p