目前比较好的Python版本是Python 3.5 和 Python 2.7对MySQL和Django的兼容性都比较好
What Python version can I use with Django?
Django version | Python versions |
---|
1.9,1.10 | 2.7,3.4,3.5 |
1.11 | 2.7, 3.4, 3.5, 3.6 |
2.0 | 3.4, 3.5, 3.6, 3.7 |
2.1, 2.2 | 3.5, 3.6, 3.7 |
官网地址:
https://docs.djangoproject.com/en/dev/faq/install/#what-python-version-can-i-use-with-django
MySQL驱动:
mysql-connector-python:是MySQL官方的纯Python驱动
MySQL-python:是封装了MySQL C驱动的Python驱动
mysqlclient:是MySQLdb连接库的一个分支,支持Python3.x,底层是用C编写的,速度更快并且官方推荐
MySQL Connector对Python的支持最高仅支持到3.4,Python3.5以上就不支持了,但可以用mysqlclient,并且官方也推荐使用mysqlclient
官方地址:
https://docs.djangoproject.com/en/dev/ref/databases/
Table 3.1 Connector/Python Version Reference
Connector/Python Version | MySQL Server Versions | Python Versions | Connector Status |
---|
8.0 (continuation of 2.2) | 8.0, 5.7, 5.6, 5.5 | 3.6, 3.5, 3.4, 2.7 | General Availability |
2.2 (continues as 8.0) | 5.7, 5.6, 5.5 | 3.5, 3.4, 2.7 | Developer Milestone, No releases |
2.1 | 5.7, 5.6, 5.5 | 3.5, 3.4, 2.7, 2.6 | General Availability |
2.0 | 5.7, 5.6, 5.5 | 3.5, 3.4, 2.7, 2.6 | GA, final release on 2016-10-26 |
1.2 | 5.7, 5.6, 5.5 (5.1, 5.0, 4.1) | 3.4, 3.3, 3.2, 3.1, 2.7, 2.6 | GA, final release on 2014-08-22 |
官网地址:
https://dev.mysql.com/doc/connector-python/en/connector-python-versions.html