py27-django and sqlite3

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


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

> I have installed the py27-django port and I'm running through the django tutorial at projectdjango [1]. I modified the project settings.py 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 manage.py 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] <https://docs.djangoproject.com/en/1.4/intro/tutorial01/>

For the record, I figured out the problem. I had the settings.py 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. 


Cheers!
Frank

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-users/attachments/20120918/6d53fa53/attachment.html>


More information about the macports-users mailing list