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!
Solution 1:
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
Solution 2:
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
.
Solution 3:
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).
Post a Comment for "How Can I Use Mysql With Python 3.3 And Django 1.5?"