Changing location of sqlite database on rpi running django
up vote
0
down vote
favorite
I am running a django project on a raspberry pi and want to move the database to an external hard drive that is connected. my settings looks like this:
DATABASES =
'default':
'ENGINE': 'django.db.backends.sqlite3',
'NAME': '/mnt/MOCStorage/database.db,
When I run manage.py migrate, I get this error:
django.db.utils.OperationalError: unable to open database file
I have mounted the drive to /mnt/MOCStorage and used chmod to change the permissions of /mnt and /mnt/MOCStorage to 775.
How can I get this database to work here?
python django sqlite web raspberry-pi
add a comment |
up vote
0
down vote
favorite
I am running a django project on a raspberry pi and want to move the database to an external hard drive that is connected. my settings looks like this:
DATABASES =
'default':
'ENGINE': 'django.db.backends.sqlite3',
'NAME': '/mnt/MOCStorage/database.db,
When I run manage.py migrate, I get this error:
django.db.utils.OperationalError: unable to open database file
I have mounted the drive to /mnt/MOCStorage and used chmod to change the permissions of /mnt and /mnt/MOCStorage to 775.
How can I get this database to work here?
python django sqlite web raspberry-pi
I don't know if it is true now, but back in the days sqlite was creating journal file in the same directory, where the database file is. That means the user who runs manage.py would require write permissions on the parent directory as well.
– piezol
Nov 8 at 18:38
both directories should be writable. I tried chmod 777 on both directories and still am not getting anything to work.
– Tim B.
Nov 8 at 18:54
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am running a django project on a raspberry pi and want to move the database to an external hard drive that is connected. my settings looks like this:
DATABASES =
'default':
'ENGINE': 'django.db.backends.sqlite3',
'NAME': '/mnt/MOCStorage/database.db,
When I run manage.py migrate, I get this error:
django.db.utils.OperationalError: unable to open database file
I have mounted the drive to /mnt/MOCStorage and used chmod to change the permissions of /mnt and /mnt/MOCStorage to 775.
How can I get this database to work here?
python django sqlite web raspberry-pi
I am running a django project on a raspberry pi and want to move the database to an external hard drive that is connected. my settings looks like this:
DATABASES =
'default':
'ENGINE': 'django.db.backends.sqlite3',
'NAME': '/mnt/MOCStorage/database.db,
When I run manage.py migrate, I get this error:
django.db.utils.OperationalError: unable to open database file
I have mounted the drive to /mnt/MOCStorage and used chmod to change the permissions of /mnt and /mnt/MOCStorage to 775.
How can I get this database to work here?
python django sqlite web raspberry-pi
python django sqlite web raspberry-pi
edited Nov 8 at 18:16
asked Nov 8 at 18:10
Tim B.
234
234
I don't know if it is true now, but back in the days sqlite was creating journal file in the same directory, where the database file is. That means the user who runs manage.py would require write permissions on the parent directory as well.
– piezol
Nov 8 at 18:38
both directories should be writable. I tried chmod 777 on both directories and still am not getting anything to work.
– Tim B.
Nov 8 at 18:54
add a comment |
I don't know if it is true now, but back in the days sqlite was creating journal file in the same directory, where the database file is. That means the user who runs manage.py would require write permissions on the parent directory as well.
– piezol
Nov 8 at 18:38
both directories should be writable. I tried chmod 777 on both directories and still am not getting anything to work.
– Tim B.
Nov 8 at 18:54
I don't know if it is true now, but back in the days sqlite was creating journal file in the same directory, where the database file is. That means the user who runs manage.py would require write permissions on the parent directory as well.
– piezol
Nov 8 at 18:38
I don't know if it is true now, but back in the days sqlite was creating journal file in the same directory, where the database file is. That means the user who runs manage.py would require write permissions on the parent directory as well.
– piezol
Nov 8 at 18:38
both directories should be writable. I tried chmod 777 on both directories and still am not getting anything to work.
– Tim B.
Nov 8 at 18:54
both directories should be writable. I tried chmod 777 on both directories and still am not getting anything to work.
– Tim B.
Nov 8 at 18:54
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Looks like you've missed the closing quotation:
'NAME': '/mnt/MOCStorage/database.db,
should read:
'NAME': '/mnt/MOCStorage/database.db',
However I would suspect this should throw a different error from the one you've mentioned, and this error may just be in your quote.
In which case perhaps try touch /mnt/MOCStorage/database.db
as the webapp user to confirm write perms.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Looks like you've missed the closing quotation:
'NAME': '/mnt/MOCStorage/database.db,
should read:
'NAME': '/mnt/MOCStorage/database.db',
However I would suspect this should throw a different error from the one you've mentioned, and this error may just be in your quote.
In which case perhaps try touch /mnt/MOCStorage/database.db
as the webapp user to confirm write perms.
add a comment |
up vote
0
down vote
Looks like you've missed the closing quotation:
'NAME': '/mnt/MOCStorage/database.db,
should read:
'NAME': '/mnt/MOCStorage/database.db',
However I would suspect this should throw a different error from the one you've mentioned, and this error may just be in your quote.
In which case perhaps try touch /mnt/MOCStorage/database.db
as the webapp user to confirm write perms.
add a comment |
up vote
0
down vote
up vote
0
down vote
Looks like you've missed the closing quotation:
'NAME': '/mnt/MOCStorage/database.db,
should read:
'NAME': '/mnt/MOCStorage/database.db',
However I would suspect this should throw a different error from the one you've mentioned, and this error may just be in your quote.
In which case perhaps try touch /mnt/MOCStorage/database.db
as the webapp user to confirm write perms.
Looks like you've missed the closing quotation:
'NAME': '/mnt/MOCStorage/database.db,
should read:
'NAME': '/mnt/MOCStorage/database.db',
However I would suspect this should throw a different error from the one you've mentioned, and this error may just be in your quote.
In which case perhaps try touch /mnt/MOCStorage/database.db
as the webapp user to confirm write perms.
answered Nov 9 at 12:17
v25
1418
1418
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53213744%2fchanging-location-of-sqlite-database-on-rpi-running-django%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I don't know if it is true now, but back in the days sqlite was creating journal file in the same directory, where the database file is. That means the user who runs manage.py would require write permissions on the parent directory as well.
– piezol
Nov 8 at 18:38
both directories should be writable. I tried chmod 777 on both directories and still am not getting anything to work.
– Tim B.
Nov 8 at 18:54