Alex Rivera | Logout

Django beginner problem: manage.py dbsync

Asked 2009-07-05T20:30:57.770
12

I'm running ubuntu 9.04 32b and got django from Synaptics. My settings.py is configured for a sqlite3 database.

I've been through this tutorial and got the following error when trying to run the command python manage.py syncdb :

Traceback (most recent call last):
  File "manage.py", line 11, in 
    execute_manager(settings)
  File "/usr/local/lib/python2.6/dist-packages/django/core/management/__init__.py", line 340, in execute_manager
    utility.execute()
  File "/usr/local/lib/python2.6/dist-packages/django/core/management/__init__.py", line 295, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.6/dist-packages/django/core/management/base.py", line 192, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/local/lib/python2.6/dist-packages/django/core/management/base.py", line 219, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python2.6/dist-packages/django/core/management/base.py", line 348, in handle
    return self.handle_noargs(**options)
  File "/usr/local/lib/python2.6/dist-packages/django/core/management/commands/syncdb.py", line 51, in handle_noargs
    cursor = connection.cursor()
  File "/usr/local/lib/python2.6/dist-packages/django/db/backends/__init__.py", line 56, in cursor
    cursor = self._cursor(settings)
  File "/usr/local/lib/python2.6/dist-packages/django/db/backends/sqlite3/base.py", line 145, in _cursor
    self.connection = Database.connect(**kwargs)
sqlite3.OperationalError: unable to open database file

Do anyone have a clue on my problem ?

Edit
Report

1 Answer

5

For Google's sake:

The path to the database must be the full path to the file --- not just the directory where the file lives.

answered 2011-08-26T00:18:24.147

Your Answer