3

I'm currently using Django on Google App Engine - Standard Environment python3

Follow the document on google - https://cloud.google.com/python/django/appengine since google app engine can't run mysqlclient, document recommend to use PyMySQL instead.

However, Django release new update 2.2 which make PyMySQL Problem and error occur state that Django require mysqlclient 1.3.13 or higher to run

django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3."

Anyone have better solution than stick with Django 2.1.8?

Thank you

2 Answers 2

6

Firstly, note that Django does not officially support PyMySQL.

For PyMySQL to work with Django 2.2, it will have to update the version_info from 1.3.12 to 1.3.13. Other changes might be required at the same time.

You can see a similar pull request 623 when the version was bumped to support Django 2.0.

You could try changing the value in PyMySQL yourself, and see if you encounter any issues with your app. You could also try running the test suite mentioned on the pull request.

The PyMySQL maintainer is a volunteer, so the more help they receive testing the changes, the more likely it is that the package will be updated sooner.

If you need a pure-python driver, another option would be to try MySQL Connector/Python. However, this has not always supported the latest Django versions immediately, so it might not work with Django 2.2 yet.

3
  • Just adding to @Alasdiar's answer, As per this pull request, The problem is not only the version number of mysqlclient. As per this ticket #30380, there may be many places in django where support for PyMySQL could be broken, and Django will not fix them(probably). Also, as per tickets #12500, #22391, Django does not support PyMySQL officially.
    – ruddra
    Apr 19, 2019 at 4:25
  • Then the better option is stick with Django 2.1 while some more time goes by??
    – ozo
    Sep 9, 2019 at 21:23
  • @Ale This pull request fo Django 2.2.X was rejected, so it looks like PyMySQL won't work with Django again until 3.0 or later. You could try MySQL Connector as I suggested above (I still don't know whether it supports Django 2.2), or try mysql_cymysql as suggested by nakagami.
    – Alasdair
    Sep 9, 2019 at 21:50
0

Perhaps django-cymysql is available agianst Google App Engine Standard. https://gist.github.com/nakagami/2c261b306a50e9ecd84734c0e74e2011#mysql

pip install django==2.2 "django-cymysql>=2.2,<2.3" cymysql

and use mysql_cymysql ENGINE

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.