py27-django and sqlite3

Frank Schima macsforever2000 at
Tue Sep 18 15:21:37 PDT 2012

On Sep 17, 2012, at 5:19 PM, Frank Schima <macsforever2000 at> wrote:

> I have installed the py27-django port and I'm running through the django tutorial at projectdjango [1]. I modified the project file to use sqlite3 as follows:
>         'ENGINE': 'django.db.backends.sqlite3',                  # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
>         'NAME': '/Users/schimaf/django/mysite/mysite',      # Or path to database file if using sqlite3.
> Everything seems to be working up to the command:
> python syncdb
> Then it fails with:
> sqlite3.OperationalError: unable to open database file
> I have the Macports sqlite3 port installed. I have permissions to the directory that it is writing to. I also tried with sudo and got the same error. I was wondering if anyone else has gotten past this problem?
> Thanks!
> Frank
> [1] <>

For the record, I figured out the problem. I had the file wrong due to misunderstanding the instructions. For NAME I was putting a path without the database filename and so it was getting confused trying to open 'mysite' which is a directory. I guess I assumed it used some standard name. So i changed it to:

        'NAME': '/Users/schimaf/django/mysite/mysite/foo.dat', # Or path to database file if using sqlite3.

And it worked fine. Sorry for the noise. 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the macports-users mailing list