icedream91
icedream91

Reputation: 51

How can I use MySQL with Python 3.3 and Django 1.5?

Django needs MySQL-python package to manipulate MySQL, but MySQL-python doesn't support Python 3.3. I have tried MySQL-for-Python-3, but it doesn't work. Please help! Thanks a lot!

Upvotes: 1

Views: 728

Answers (3)

theblang
theblang

Reputation: 10425

Oracle now has a MySQL connector for Python 3.3 that works with Django. See this link.

After you install, use mysql.connector.django for your ENGINE value under DATABASES in your settings.py.

Upvotes: 1

jeffknupp
jeffknupp

Reputation: 6274

As others have noted, Python 3 support in Django 1.5 is "experimental" and, as such, not everything should be expected to work.

That being said, if you absolutely need to get this working, you may be able to run the 2to3 tool on a source version of MySQL-python to translate it to Python 3 (and build against Python 3 headers if required).

Upvotes: 0

Django 1.5 works under Python 2.7, so you need the MySQL-python package for that distribution of Python; just do:

sudo apt-get install python-mysqldb

Upvotes: 2

Related Questions