{{{
try:
import pymysql
pymysql.install_as_MySQLdb()
except ImportError:
pass
}}}
I think it would help python 3 adoption if users could use django and
pymysql without additional steps.
--
Ticket URL: <https://code.djangoproject.com/ticket/22391>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_docs: => 0
* has_patch: 0 => 1
* needs_tests: => 0
* needs_better_patch: => 0
Comment:
https://github.com/django/django/pull/2520
--
Ticket URL: <https://code.djangoproject.com/ticket/22391#comment:1>
* stage: Unreviewed => Accepted
Comment:
I agree it'd be nice to have support for pymysql, and I actually worked on
it a little while ago before giving up.
I don't think a fallback mechanism is the right approach though, I'd much
prefer a minimal yet separate db backend that'd leverage most of the
implementation of the default backend.
Did you manage to get the test suite to work with this patch? I remember
running into a lot of issues when I tried.
--
Ticket URL: <https://code.djangoproject.com/ticket/22391#comment:2>
Comment (by aaugustin):
Related: #12500.
--
Ticket URL: <https://code.djangoproject.com/ticket/22391#comment:3>
Comment (by anonymous):
I have also a dedicated branch for this:
https://github.com/claudep/django/tree/pymysql. However, I think the test
suite does not entirely pass with that patch.
--
Ticket URL: <https://code.djangoproject.com/ticket/22391#comment:4>
Comment (by CollinAnderson):
It looks like testing against the latest version of pymysql, 0.6.1
(October 2013), there are some errors, but, using pymysql's master branch,
there are at least fewer errors. Some recent things that have been fixed
are Thing2Literal and query encoding. I also have a pull request in to fix
dates before 1900. It looks like there's a ticket open for timezone
support.
It seems to me we should try to fix pymysql as much as possible to try to
get it compatible with MySQLdb, and then require the latest version of
pymysql.
Also, I'm personally interested in also using pymysql on python2.7, so I
would prefer the fallback approach myself. Though, it's clear the real
benefit of this is for python 3.
--
Ticket URL: <https://code.djangoproject.com/ticket/22391#comment:5>
Comment (by CollinAnderson):
My "fix dates before 1900" change just merged.
https://github.com/PyMySQL/PyMySQL/pull/232
--
Ticket URL: <https://code.djangoproject.com/ticket/22391#comment:6>
* needs_better_patch: 0 => 1
Comment:
Maybe this needs discussion on the mailing list for a resolution. One
question I have is how we are going to ensure that it doesn't break if we
merge it to core. Do we need another MySQL build to the Jenkins matrix?
--
Ticket URL: <https://code.djangoproject.com/ticket/22391#comment:7>
* needs_better_patch: 1 => 0
Comment:
My branch merges cleanly again.
https://github.com/django/django/pull/2520#issuecomment-45358916
https://github.com/collinanderson/django/compare/ticket_22391
--
Ticket URL: <https://code.djangoproject.com/ticket/22391#comment:8>
* cc: cmawebsite@… (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/22391#comment:9>
* needs_better_patch: 0 => 1
Comment:
If I understand correctly we at least need CI support for testing pymysql
builds? Also, if In understand correctly there are still some errors with
pymysql?
The best way forward is to ask for CI support for pymysql builds on
django-developers mailing list.
I'll set patch needs improvement for lack of better marker that this
ticket isn't ready for merge.
--
Ticket URL: <https://code.djangoproject.com/ticket/22391#comment:10>
Comment (by collinanderson):
Sorry, I should link to the django-developers ghost-thread, and maybe bump
it. https://groups.google.com/d/topic/django-
developers/n-TI8mBcegE/discussion
--
Ticket URL: <https://code.djangoproject.com/ticket/22391#comment:11>
Comment (by timgraham):
Do we still need this now that we have support for mysqlclient (with no
changes to Django)?
--
Ticket URL: <https://code.djangoproject.com/ticket/22391#comment:12>
* status: new => closed
* resolution: => wontfix
Comment:
I think I'm fine with closing for now, though I still think pymysql is
quite popular due to it being pure python.
--
Ticket URL: <https://code.djangoproject.com/ticket/22391#comment:13>