Django 1.7 not working with mysql-connector-python 1.1.6 & Python 3.3 ?

1,439 views
Skip to first unread message

Giovanni

unread,
Apr 2, 2014, 6:42:55 PM4/2/14
to django...@googlegroups.com
I upgraded from django 1.6 to 1.7b1 and now it seems like as soon as I want to do anything that interacts with mysql, I keep getting this error:

NotImplementedError: subclasses of BaseDatabaseWrapper may require a schema_editor() method

In Python I can import mysql.connector just fine.
I've reinstalled mysql 5.6.17 community server.

Any ideas?

Giovanni

unread,
Apr 3, 2014, 11:09:31 AM4/3/14
to django...@googlegroups.com
Documentation states:
  • syncdb has been deprecated and replaced by migrate. Don’t worry - calls to syncdb will still work as before.


But when I run $ python manage.py syncdb,
it stops with a django.utils.deprecation.RemovedInDjango19Warning.

So I can't seem to use syncdb either.

Richard Esplin

unread,
May 5, 2014, 8:17:57 PM5/5/14
to django...@googlegroups.com
I am also trying to use Django 1.7 with the Mysql-Python-Connector 1.1.6. I am seeing the same behavior for both the migrate NotImplementedError and the syncdb RemovedInDjango19Warrning.

Were you able to solve these problems?

Richard

Richard Esplin

unread,
May 5, 2014, 8:45:19 PM5/5/14
to django...@googlegroups.com
I can't find any evidence on the interwebs of someone successfully using the Mysql-Connector-Python with Django 1.7. So I reported it as an issue in the MySQL bug database:

http://bugs.mysql.com/bug.php?id=72542

If anyone has a suggestion for using MySQL with Python 3 and Django 1.7, I would appreciate hearing them.

Thanks,

Richard

Richard Esplin

unread,
May 6, 2014, 1:10:37 AM5/6/14
to django...@googlegroups.com
This is actually a warning, and only halts execution when settings.py has DEBUG enabled. See mysql/connector/django/base.py line 59.

However when syncdb proceeds past the deprecation warning, it halts on the error about needing schema_editor implemented.


On Thursday, April 3, 2014 9:09:31 AM UTC-6, Giovanni wrote:

Richard Esplin

unread,
May 6, 2014, 11:52:07 AM5/6/14
to django...@googlegroups.com
In order to move forward with this project, I switched to PyMySQL:

https://github.com/PyMySQL

It appears to work great. In order to use the default Django backend for MySQL, I put this in my settings.py:

import pymysql
pymysql.install_as_MySQLdb()

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
. . . .

I have a few months of testing before I'll know if it is reliable, but at least I can move forward with development.

Richard

Giovanni

unread,
May 9, 2014, 5:49:11 PM5/9/14
to django...@googlegroups.com
I switched to PostgreSQL when MySQL wasn't working. PostgreSQL worked without a hitch and the migrations work wonderfully. But since my target production environment only runs MySQL I will have to make the switch back at some point.

Thanks for submitting the bug to MySQL. I see they posted a somewhat generic answer.

Richard Esplin

unread,
May 9, 2014, 7:00:12 PM5/9/14
to django...@googlegroups.com, Giovanni
Thanks for sharing what you did. I wish PostgreSQL was an option for me on
this project.

Oracle's answer was pretty generic, but they are right that Django 1.7 is
still in development. It is good to know that they are planning to support it
when it is released. I am glad I don't have to roll-out 1.6 and then manage an
upgrade a few months after our launch.

PyMySQL appears to work fine, but I haven't benchmarked it yet. Knowing that I
can drop in the Oracle connector if there is a problem makes me confident to
move forward.

Cheers,

Richard

On Friday, May 09, 2014 14:49:11 Giovanni wrote:
> I switched to PostgreSQL when MySQL wasn't working. PostgreSQL worked
> without a hitch and the migrations work wonderfully. But since my target
> production environment only runs MySQL I will have to make the switch back
> at some point.
>
> Thanks for submitting the bug to MySQL. I see they posted a somewhat
> generic answer.
>
> On Tuesday, May 6, 2014 11:52:07 AM UTC-4, Richard Esplin wrote:
> > In order to move forward with this project, I switched to PyMySQL:
> >
> > https://github.com/PyMySQL
> >
> > It appears to work great. In order to use the default Django backend for
> > MySQL, I put this in my settings.py:
> >
<snip>

cico

unread,
Aug 28, 2014, 11:40:06 AM8/28/14
to django...@googlegroups.com, gko...@gmail.com
And I wish I could upvote your solution to heaven!
Thanks for sharing that, why is it not documented anywhere? Sounds like a killing feature..

Cheers!
mccc

yamil moreno

unread,
Sep 26, 2014, 11:18:46 AM9/26/14
to django...@googlegroups.com

No hablo inglés.

Tenía el mismo problema. 

1 - Lo que hice fue actualizar mi versión de Python (Python 2.7.* a Python 3.3.5).
2 - Descargue el driver de MySQL para Python 3.3.* ( mysql-connector-python-2.0.1-py3.3.msi ) 
3 - Deje los parámetros del archive SETTINGS ENGINE así ( 'ENGINE': 'mysql.connector.django' )
4 - Cambie los métodos  __unicode__(self):   a  __str__(self).

# Todo funciona muy bien.


yamil moreno

unread,
Sep 26, 2014, 11:21:29 AM9/26/14
to django...@googlegroups.com

Felipe Serrano

unread,
Dec 19, 2014, 12:59:16 AM12/19/14
to django...@googlegroups.com
Same problem, your Fix works great!... Thanks, using

MacOS 10.7, Django 1.7, DjanogCMS3, Python 3.4.2
Reply all
Reply to author
Forward
0 new messages