88👍
PROBLEM You’re using SQLite3, your DATABASE_NAME is set to the
database file’s full path, the database file is writeable by Apache,
but you still get the above error.SOLUTION Make sure Apache can also write to the parent directory of
the database. SQLite needs to be able to write to this directory.Make sure each folder of your database file’s full path does not start
with number, eg. /www/4myweb/db (observed on Windows 2000).If DATABASE_NAME is set to something like
‘/Users/yourname/Sites/mydjangoproject/db/db’, make sure you’ve
created the ‘db’ directory first.Make sure your /tmp directory is world-writable (an unlikely cause as
other thing on your system will also not work). ls /tmp -ald should
produce drwxrwxrwt ….Make sure the path to the database specified in settings.py is a full
path.Also make sure the file is present where you expect it to be.
21👍
I faced exactly same issue. Here is my setting which worked.
'ENGINE': 'django.db.backends.sqlite3',
'NAME': '/home/path/to/your/db/data.sqlite3'
Other setting in case of sqlite3 will be same/default.
And you need to create data.sqlite3.
- [Django]-(13: Permission denied) while connecting to upstream:[nginx]
- [Django]-Is it possible to pass query parameters via Django's {% url %} template tag?
- [Django]-Django development server reload takes too long
11👍
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.
- [Django]-What is the difference render() and redirect() in Django?
- [Django]-How do I get odd and even values in a Django for loop template?
- [Django]-Django: no such table: django_session
8👍
You need to use full path instead of ~/
.
In your case, something like /home/harold/Harold-Server/OmniCloud.db
.
- [Django]-How can I find the union of two Django querysets?
- [Django]-Django/DRF – 405 Method not allowed on DELETE operation
- [Django]-How Can I Disable Authentication in Django REST Framework
6👍
In my case the sqlite db file db.sqlite3
was stored in the DocumentRoot
of apache. So, even after setting the following permissions it didn’t work:
sudo chown www-data:www-data /path/to/db-folder
sudo chown www-data:www-data /path/to/db-folder/sqlite-db.db
Finally when i moved db.sqlite3
to a newly created folder dbfolder
under DocumentRoot
and gave the above permissions, and it worked.
- [Django]-Django template tag to truncate text
- [Django]-How to receive json data using HTTP POST request in Django 1.6?
- [Django]-Django unit tests without a db
2👍
I had this problem serving with Apache and found that using the absolute path to the sqlite3 db in my .env ////
as opposed to using the relative path ///
fixed the problem. All of the permissions and ownership mentioned above are necessary as well.
- [Django]-How to reset Django admin password?
- [Django]-(13: Permission denied) while connecting to upstream:[nginx]
- [Django]-Can we append to a {% block %} rather than overwrite?
1👍
use this type it works for me .
windows 7 with python 2.7 and django 1.5
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'C:\\tool\\mysite\\data.db',
hope its works…
- [Django]-How to override and extend basic Django admin templates?
- [Django]-Django, query filtering from model method
- [Django]-How can I find the union of two Django querysets?
0👍
In the same case, the problem was in empty write permissions.
sudo chmod -R o+w ./dir/
- [Django]-Django template can't loop defaultdict
- [Django]-How to define two fields "unique" as couple
- [Django]-Setting the selected value on a Django forms.ChoiceField