Forums

Unable to open a simple database file

Hi,

I am trying to open a simple database file using sqllite3 command. However I get an error saying unable to open the database file. I am giving the absolute path and dont know what is going wrong. Any help is appreciated and you can go ahead and look at the files at your end.

double check this?

Hi,

I believe that I have setup the correct permissions but I am still getting the same error. What my understanding is that I have to give to the database and also the directory in which the database is stored. I have done that, but I am still getting the same error. Here are the permissions:

<li>-rwxrwxrwx 1 edmoneyball registered_users 96403456 Apr 23 2016 EducationData1.db (for the file) </li> <li>drwxrwxrwx 4 edmoneyball registered_users 4096 Apr 23 2016 mysite (the directory) </li>

I have setup correct path setup in setting.py:

    DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': '/home/edmoneyball/mysite/edmoneyball/mysite/edmoneyball/EducationData1.db',
    }
}

and also in the line of code where I am trying to open the database file: 'home/edmoneyball/mysite/edmoneyball/mysite/edmoneyball/EducationData1.db'

So I am at a loss of where I am going wrong with this.

For the code, you are missing a '/' in front of home.

For the webapp, have you reloaded your webapp after making that change?

Yes that worked! i was missing the "/"