That makes sense..... Can you please tell me then, if os.path.dirname(os.path.abspath( __file__ )) + '/ database/local.db', would be something relative to SQLite?
Many thanks *José Pablo Méndez * On Sun, Apr 24, 2011 at 1:34 AM, Daniel Roseman <dan...@roseman.org.uk>wrote: > On Sunday, April 24, 2011 7:46:43 AM UTC+1, Hurin wrote: >> >> Hi, >> >> I have a python script where I have to fill the following info to >> connect to my DB: >> >> DATABASES = { >> 'default': { >> 'ENGINE': 'sqlite3','mysql', # Add 'postgresql_psycopg2', >> 'postgresql', 'mysql', 'sqlite3' or 'oracle'. >> 'NAME': os.path.dirname(os.path.abspath( __file__ )) + '/ >> database/local.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 am not familiar with python, I know that os.path.dirname is a way to >> reference the location where the script is being run, but I am not >> sure if it is the right syntax to point to my database. Should I leave >> it like that or would it be something like >> >> mysql://localhost:3306/dbName" >> >> For reference, I am trying to install CDR-Stats and I have python- >> django and python-mysqldb installed. >> >> Thanks to whoever can point me out in the right direction > > > The file path of the script has nothing to do with this. You need to put in > how the script accesses the database. For you: > > DATABASES = { > 'default': { > 'ENGINE': 'mysql', > 'NAME': 'dbName', > 'USER': '', > 'PASSWORD': '', > 'HOST': '', > 'PORT': '', > }, > > Your HOST and PORT are the defaults, so they can be left blank. You will > need to put in the username and password of your MySQL user though. > -- > 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+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.