Python 和 Django 及 MySQL 版本对应

Admin 2018-07-11 12:19:39 Django,Python

目前比较好的Python版本是Python 3.5 和 Python 2.7对MySQL和Django的兼容性都比较好


What Python version can I use with Django?

Django versionPython versions
1.9,1.102.7,3.4,3.5
1.112.7, 3.4, 3.5, 3.6
2.03.4, 3.5, 3.6, 3.7
2.1, 2.23.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 VersionMySQL Server VersionsPython VersionsConnector Status
8.0 (continuation of 2.2)8.0, 5.7, 5.6, 5.53.6, 3.5, 3.4, 2.7General Availability
2.2 (continues as 8.0)5.7, 5.6, 5.53.5, 3.4, 2.7Developer Milestone, No releases
2.15.7, 5.6, 5.53.5, 3.4, 2.7, 2.6General Availability
2.05.7, 5.6, 5.53.5, 3.4, 2.7, 2.6GA, final release on 2016-10-26
1.25.7, 5.6, 5.5 (5.1, 5.0, 4.1)3.4, 3.3, 3.2, 3.1, 2.7, 2.6GA, final release on 2014-08-22


官网地址:

https://dev.mysql.com/doc/connector-python/en/connector-python-versions.html

相关文章
最新推荐