faridghar
faridghar

Reputation: 1515

Django and Connector/Python Integration

How can I setup a Django 1.5.1 app running with Python 3.3 to access a MySQL database? I tried using MySQLdb but apparently it doesn't support Python 3.3.

My next intention was to use Connector/Python, but what am I supposed to put for the "Engine" key of the Databases dictionary of the settings.py file?

If someone could provide detailed steps of how to get Django to work with Connector/Python, that would be great!

Upvotes: 1

Views: 1032

Answers (1)

Thomas
Thomas

Reputation: 11888

MySQLdb is the Python interface to MySQL [supported by django]. Version 1.2.1p2 or later is required for full MySQL support in Django.

At the time of writing, the latest release of MySQLdb (1.2.4) doesn’t support Python 3. In order to use MySQL under Python 3, you’ll have to install an unofficial fork, such as MySQL-for-Python-3.

This port is still in alpha. In particular, it doesn’t support binary data, making it impossible to use django.db.models.BinaryField.

Basically your only options to avoid Alpha quality drivers are:

  1. Don't use python 3.
  2. Don't use MySQL.

Hopefully this makes the choice easier: http://grimoire.ca/mysql/choose-something-else

REF: https://docs.djangoproject.com/en/dev/ref/databases/#python-3

Upvotes: 2

Related Questions