Unable to open database file ( Asking graphite and django forum )

520 views
Skip to first unread message

KriRad

unread,
Apr 6, 2012, 1:25:28 AM4/6/12
to Django users
Hi,

I have read previous mail in many forums and tried the suggestions.
The error is "pysqlite2.dbapi2.OperationalError: unable to open
database file"

Read/Write permissions are given

Command run is

sudo /usr/bin/python manage.py syncdb

settings.py is

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqllite3', # Add
'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': '/home/admin/django/db/nio.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.


I have 3 settings.py files

/usr/lib/pymodules/python2.7/django/conf/project_template/
settings.py:DATABASES = {
/usr/lib/pymodules/python2.6/django/conf/project_template/
settings.py:DATABASES = {
/usr/share/pyshared/django/conf/project_template/settings.py:DATABASES
= {

Some more information. I am not using python2.6 because when I type
'python' I get the following prompt.
Python 2.7.2+ (default, Oct 4 2011, 20:03:08)
[GCC 4.6.1] on linux2

I have updated both the following files.
/usr/lib/pymodules/python2.7/django/conf/project_template/settings.py
/usr/share/pyshared/django/conf/project_template/settings.py


Thanks,
Mohan

Ejah

unread,
Apr 6, 2012, 5:10:42 AM4/6/12
to Django users
Hi,
Two things spring to mind immediately:
One: You have a double 'l' in ENGINE': 'django.db.backends.sqllite3'
Two: Do you have the proper rights in the 'db' directory to create/
write/read?
HTH
Ernst

KriRad

unread,
Apr 6, 2012, 6:07:58 AM4/6/12
to Django users

Corrected sqllite3.

drwxrwxrwx 2 admin admin 4096 2012-04-06 17:56 db

I am at my wits' end. RRDTool seems enticing.

Thanks.
> > Mohan- Hide quoted text -
>
> - Show quoted text -

Ejah

unread,
Apr 6, 2012, 12:04:37 PM4/6/12
to Django users


Having better read your first posting, the problems lies before this.
You are supposed to create a project first through django-admin. This
will create a template directory where your own settings.py and
manage.py resort. You now seem to be editting the framework templates,
and that will not work.
I suggest you head over to djangoproject.com and start with.the
tutorials.
I would only be copying from there.
Success
hth
Reply all
Reply to author
Forward
0 new messages