harijay - 2010-01-27

Hi I had an exchange with the django devel list which suggests that something
in the MySQLdb svn version (635) is changed compared to the Release version (
which works fine with django).

The problem is in the following statement:

from MySQLdb.converters import conversions

This returns an error with svn version , but works fine in the release
version.

I am using the Mysql-python release version now , but thought I would pass
this information along.

hari

In any case I will reproduce my communication with Russel Magee at the django
list here:

On Tue, Jan 5, 2010 at 3:38 PM, harijay hari...@gmail.com wrote:

Hi I just started using the subversion build of django and mysql-

python with python 2.6.3

Both django (svn 12103) and _mysql (MySQLdb rev 635) work fine and can

be imported from the command line python without any error messages.

I created a new django testproject and then modified my settings.py to

use the mysql backend ( see DATABASE section below).

But when I start python manage.py runserver 8080 , I get an error

which I am reproducing here indicating that the backend was not

started.

Any ideas on what I need to change to have my django launch with the

mysql backend.

Thanks

harijay

The error I get is

^Chariharan-jayarams-macbook-pro-17:testdjnew hari$ python manage.py

runserver 8080

Validating models...

Unhandled exception in thread started by <function inner_run at

0x7a3670>

Traceback (most recent call last):

File "/Users/hari/djtrunk/django/core/management/commands/

runserver.py", line 48, in inner_run

self.validate(display_num_errors=True)

File "/Users/hari/djtrunk/django/core/management/base.py", line 249,

in validate

num_errors = get_validation_errors(s, app)

File "/Users/hari/djtrunk/django/core/management/validation.py",

line 22, in get_validation_errors

from django.db import models, connection

File "/Users/hari/djtrunk/django/db/init.py", line 74, in

<module>

connection = connections

File "/Users/hari/djtrunk/django/db/utils.py", line 75, in

getitem

backend = load_backend(db)

File "/Users/hari/djtrunk/django/db/utils.py", line 37, in

load_backend

raise ImproperlyConfigured(error_msg)

django.core.exceptions.ImproperlyConfigured:

'django.db.backends.mysql' isn't an available database backend.

Try using django.db.backends.XXX, where XXX is one of:

'dummy', 'mysql', 'oracle', 'postgresql', 'postgresql_psycopg2',

'sqlite3'

Error was: cannot import name conversions

I haven't seen this error before, but it sounds like there might be

something wrong (or incompatible) with your MySQLdb install.

You should be able to run the following at a Python prompt:

from MySQLdb.converters import conversions

The error you are seeing suggests that this is not the case.

The fact that you report your MySQLdb install as 'rev 635' suggests

that you're using a development version of MySQLdb. Either MySQLdb has

introduced a backwards incompatibility, or your build is incomplete or

contains errors.

To confirm this, I would suggest using a production version of MySQLdb

  • recent production releases are known to work.
    If it turns out that there has been a backwards incompatible

regression in MySQLdb, we will need to address that when a formal

release that contains that change is made.

Yours,

Russ Magee %-)