views:

290

answers:

2

I installed jython, django on my windows system. I successfully created a project mysite. Now after updating settings in settings.py. i ran 'manage.py' and got the error- Import error - "no module named mysqldb". now, i downloaded mysqldb (which is for python, but i thought it will work for jython also) and i tried to install it. but now i am getting the following error- import error - "no module named '_winreg'".

what does it mean? how to get around this problem? i am a completely new bee to jython and django, please help.

+2  A: 

MySQLdb is the CPython MySQL library, so it won't work with Jython.

You'll want to use zxJDBC to connect to MySQL from Jython: http://jython.org/Project/userguide.html#database-connectivity-in-jython

You'll need to add the MySQL jdbc jar to your classpath

Todd Moses
thanx.. let me try it!!
Nitin Garg
+1  A: 

You'll need to install django-jython in order to get Django working on Jython. Note that it will use zxJDBC and not MySQLdb.

Ignacio Vazquez-Abrams
django-jython is neccessary? i thought it was an option!!so now i need to install django-jython, jdbc and zxJDBC!!
Nitin Garg
JDBC is a spec, not a piece of software. zxJDBC comes with Jython. django-python is required to make Django use zxJDBC instead of the CPython DB-API adapters.
Ignacio Vazquez-Abrams