Home  >  Article  >  Backend Development  >  Django reports that there is no module MySQLdb under Python 3.5.

Django reports that there is no module MySQLdb under Python 3.5.

怪我咯
怪我咯Original
2017-06-27 09:47:171692browse

Write the following code in the __init__.py file under the entire project site (that is, in the same file as setting.py):

import pymysql
pymysql.install_as_MySQLdb()

You need to install the pymysql module in advance , equivalent to the MySQLdb module in Python2.

will solve the problem.

The above is the detailed content of Django reports that there is no module MySQLdb under Python 3.5.. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn