Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django database connection error: "sqlite3.OperationalError: unable to open database file"

Tags:

python

django

So I just created a new project and app for the blog. When I try and syncdb it says: "sqlite3.OperationalError: unable to open database file"

I saw the noob FAQ and it says the possible errors are having an incorrect path or not giving apache permission to write to the folder.

Here is a dpaste with my settings.py and some terminal outputs to give you an idea of what's up.

http://dpaste.org/eQUm/

If the solution is to give apache permission to write, how would i do it? I am running the server on a personal computer on ubuntu.

like image 586
zallarak Avatar asked Mar 18 '26 10:03

zallarak


1 Answers

You need to give the path to the database file, look at your database settings:

'NAME': '/home/vmplanet/code/blog', # Or path to database file if using sqlite3.

...which is presumably the project directory. Try /home/vmplanet/code/blog/blog.db.

like image 54
zeekay Avatar answered Mar 19 '26 23:03

zeekay



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!