views:

42

answers:

1

hello, after running "python manage.py syncdb" i gett an error saying "unable to open database file".

here is the important part from my settings.py:

DATABASE_ENGINE = 'sqlite3'    # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = 'apps.db'      # Or path to database file if using sqlite3.
DATABASE_USER = ''             # Not used with sqlite3.
DATABASE_PASSWORD = ''         # Not used with sqlite3.
DATABASE_HOST = ''             # Set to empty string for localhost. Not used with sqlite3.
DATABASE_PORT = ''             # Set to empty string for default. Not used with sqlite3.

and here are the permissions for "apps.db":

-rw-r--r-- 1 root root 33792 19. Jul 10:51 apps.db

My django server is called from apache... i don't know if it has to do with the permissions but changing the owner of apps.db to "www-data" did not work either

[edit]

to ensure www-data can access all of this i did the following:

did the following:

chown -R www-data apps
rm apps.db
su www-data
python manage.py syncdb

but it still does not work :(

A: 

I solved the error by changing the DATABASE_NAME to an absolute path: "/var/www/apps/apps.db"

niklasfi