开发者

Debugging Django project problem

I asked this question before, but had no replies, maybe I wasn't so clear.

I'm trying to debug a django project using MySQL database. If I run the admin or trying to use the shell to communicate to the data base every thing is well and I can do every thing. I installed MySQLdb for Python 2.6.

I installed PyDev on my Apatana studio. Configured the Debugging with runserver 8001 --noreload.

When I start debugging , When I arrive to the following code in C:\Python26\Lib\site-packages\django\db\backends\mysql\base.py

try: import MySQLdb as Database except ImportError, e: from django.core.exceptions import ImproperlyConfigured

raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)

I get an import error : django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: DLL load failed: The specified module could not be found.

I trying to ge more deeply with the import MySQLdb as Database line , it goes to the C:\Python26\Lib\site-packages\MySQLdb__init__.py and fail in the line import _m开发者_Python百科ysql.

I can't understand the problem. When running the Django admin every thing is ok, but with debugging it fails to work.

Any help please. Thanks in advance.


I had this problem and it turned out to be that I had the python paths in Aptana setup wrong. In Aptana -> Preferences -> PyDev -> Interpreter -> PythonRun

I had /Library/Python/2.5/site-packages/ whereas all my packages were actually in /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages

Fixed this and all was well!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜