I get this error when setting up a server in Django. It is sqlite3 which means it should create the .db file but it doesn't seem to be doing so. I've stipulated SQLite as the backend and an absolute file path for where to put it, but no luck.
Is this a bug or am I doing something incorrect? (Was just thinking, is the absolute file path specified differently in Ubuntu?)
Here is the beginning of my settings.py file:
# Django settings for OmniCloud project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': '~/Harold-Server/OmniCloud.db', # Or path to database file if using sqlite3.
'USER': '', # Not used with sqlite3.
'PASSWORD': '', # Not used with sqlite3.
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
}
}
In my case the sqlite db file
db.sqlite3
was stored in theDocumentRoot
of apache. So, even after setting the following permissions it didn't work:Finally when i moved
db.sqlite3
to a newly created folderdbfolder
underDocumentRoot
and gave the above permissions, and it worked.You haven't specified the absolute path - you've used a shortcut ,
~
, which might not work in this context. Use/home/yourusername/Harold-Server/OmniCloud.db
instead.You need to use full path instead of
~/
.In your case, something like
/home/harold/Harold-Server/OmniCloud.db
.use this type it works for me . windows 7 with python 2.7 and django 1.5
hope its works...
I faced exactly same issue. Here is my setting which worked.
Other setting in case of sqlite3 will be same/default.
And you need to create data.sqlite3.
Django NewbieMistakes