You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File "/home/mario/Envs/danny/local/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", line 346, in get_new_connection
conn = Database.connect(**conn_params)
django.db.utils.OperationalError: unable to open database file
I think the error is due to this part inside templates/1.6.x/project_name/settings.py:
On my ubuntu BASE_DIR points to /home/mario.., so the db url takes value of:
sqlite:///home/mario..
in this case django is trying to open home/mario.. (notice no starting slash). Since it cannot open the file, it throws db error.
To solve it, I use three slashes instead of two (sqlite:///%s), which seems to work fine in ubuntu and windows. But I'm not sure if that's the best solution.
The text was updated successfully, but these errors were encountered:
I solved it by changing the directory of my db, the thing is that some of my team members changed the manage.py to a top position and the relative path wasn't properly configured.
I create django project using the command given in the docs:
django-admin.py startproject mysite -v2 --template https://github.com/jezdez/django-configurations/archive/templates/1.6.x.zip
I do:
manage.py syncdb
This happens:
I think the error is due to this part inside
templates/1.6.x/project_name/settings.py
:DATABASES = values.DatabaseURLValue('sqlite://%s' % os.path.join(BASE_DIR, 'db.sqlite3'), environ=True)
On my ubuntu
BASE_DIR
points to/home/mario..
, so the db url takes value of:sqlite:///home/mario..
in this case django is trying to open
home/mario..
(notice no starting slash). Since it cannot open the file, it throws db error.To solve it, I use three slashes instead of two (
sqlite:///%s
), which seems to work fine in ubuntu and windows. But I'm not sure if that's the best solution.The text was updated successfully, but these errors were encountered: