gamer
gamer

Reputation: 5863

django with sqlite unable to open database file

I have sqlite database setting like in my production server :

DATABASES = {
'default': {
    'ENGINE': 'django.db.backends.sqlite3',
    'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}

}

I have also tried chown www-data path_to_db and chmod 777 path_to_db

I am using celery, rabbitmq and supervisor in this application.. but its still showing error saying unable to open database.. whats the issue here

Upvotes: 0

Views: 2245

Answers (2)

gamer
gamer

Reputation: 5863

This worked for me:

chown www-data path_to_directory_containing_db

Upvotes: 3

Serafim Suhenky
Serafim Suhenky

Reputation: 2160

First lets find out the value of BASE_DIR. Add to your settings.py

print "base dir %s" % BASE_DIR

And run server. You'll see your base_dir and could ensure that file is in right place.

Upvotes: 0

Related Questions