I am using Python version 2.5.4 and install MySQL version 5.0 and Django. Django is working fine with Python, but not MySQL. I am using it in Windows Vista.
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Django __str__ returned non-string (type NoneType)
- Evil ctypes hack in python
Note this is not tested for python 3.x
In CMD
in settings.py
It worked with me
I met the same situation under windows, and searched for the solution.
Seeing this post Install mysql-python (Windows).
It points out installing such a pip environment is difficult, needs many other dependencies.
But I finally know that if we use
mysqlclient
with a version down to1.3.4
, it don't need that requirements any more, so try:I have tried methods above, but still no module named 'MySQLdb', finally, I succeed with
my env is unbuntu 14.04
and then add this two lines to your Project/Project/init.py
Works on WIN and python 3.3+
Ubuntu:
If you are running on Vista, you may want to check out the Bitnami Django stack. It is an all-in-one stack of Apache, Python, MySQL, etc. packaged with Bitrock crossplatform installers to make it really easy to get started. It runs on Windows, Mac and Linux. Oh, and is completely free :)