Getting “Error loading MySQLdb module: No module named MySQLdb” in django-cms

纵饮孤独 提交于 2019-12-05 10:12:45

问题


I can't connect with mysql and I can't do "python manage.py syncdb" on it

how to connect with mysql in django and django-cms without any error?


回答1:


to connect to mysql with django

sudo apt-get install git          # to install git

sudo apt-get install python-pip   # to install pip

sudo pip install Django           # to install Django to your system

After that you should go to project path and then execute the following command, the same path of 'manage.py' file

pip install mysql-python

Finally you may synchronous your database without problem

python manage.py syncdb



回答2:


This is an error message you get if MySQLdb isn't installed on your computer.

The easiest way to install it would be by entering pip install MySQL-python into your command line.



来源:https://stackoverflow.com/questions/24380269/getting-error-loading-mysqldb-module-no-module-named-mysqldb-in-django-cms

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!