0

I'm using Django with MySQL (mysql-python 1.2.5) and I can run python manage.py runserver 0.0.0.0:8000 fine. I would like to deploy my Django app with Gunicorn by running gunicorn -b 0.0.0.0:8000 wsgi:application. However, Django's throwing error with MySQLdb:

File "/Library/Python/2.7/site-packages/django/db/backends/mysql/base.py", line 28, in <module>
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb

Any idea why it has this error? Thanks.

  • http://stackoverflow.com/questions/2952187/getting-error-loading-mysqldb-module-no-module-named-mysqldb-have-tried-pre.. Try sudo apt-get install python-mysqldb – Abijith Mg Apr 11 '17 at 05:38
  • Thanks, I just stop all python web process and restart server, and it solved the problem – nguyenhoang tam Apr 13 '17 at 17:56

0 Answers0