hi,
I execute the command: python manage.py createsuperuser --
username=jack --email=ja...@f.com
and an error occurred:
Traceback (most recent call last):
File "manage.py", line 11, in <module>
<snip>
File "/usr/lib/python2.6/site-packages/django/db/backends/ sqlite3/
base.py", line 200, in execute
return Database.Cursor.execute(self, query, params)
django.db.utils.DatabaseError: unable to open database file
the database in settings.py is like this:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add
'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': '/home/jack/django/mysite/data/
db.db', # Or path to database file if using
sqlite3.
'USER': '', # Not used with sqlite3.
'PASSWORD': '', # Not used with sqlite3.
'HOST': '', # Set to empty string for
localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for
default. Not used with sqlite3.
}
}
can someone tell me why the error occurred? Thanks.
Have you run `manage.py syncdb` first? You need that to create the db and the tables.
--
DR.
-- You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment