#29309: Recommended MySQL Setup Does Not Work Properly
-------------------------------------+-------------------------------------
               Reporter:             |          Owner:  nobody
  NewReStarter                       |
                   Type:             |         Status:  new
  Cleanup/optimization               |
              Component:             |        Version:  2.0
  Documentation                      |
               Severity:  Normal     |       Keywords:  Database Setup
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  1
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 Python 3.6.1
 Django 2.0
 Mac OS 10.13.3

 Following the instruction given in
 https://docs.djangoproject.com/en/2.0/ref/databases/#mysql-notes,
 installed pymysql with pip and then modified the settings.py to set up the
 adaptor according to https://dev.mysql.com/doc/connector-python/en
 /connector-python-django-backend.html, the url given by the official
 document.

 Then when executing {{{python3 manage.py makemigrations}}} error appears
 which displays {{{ImportError: No module named 'MySQLdb}}}. It is likely
 that django still uses MySQLdb, which is not supported by python3, as
 default in the release.

 The fix that works for me would be adding following code in the
 {{{__init__.py}}} of the site to use pymysql to replace mysqldb.

 {{{
 import pymysql
 pymysql.install_as_MySQLdb()
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29309>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/055.eb0c9a251837c1e856f8ddee2a6b1536%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to