You can't use above version of django 2.0 with pymysql.
On Mon, 7 Oct 2019, 03:24 'Dick in Texas' via Django users, < django-users@googlegroups.com> wrote: > I have tried to use a new, empty database, but that did not work. Still > got the question if I have installed MySQLclient. > > Tried the statements from Desh Deepak. The install and import went well. > However, when I tried to migrate, I got the message: module 'pymysql' has > no attribute 'install_as_MySqldb'. I put this statement directly below the > import statement. > > > Below is some of my additional background info that may help. > > i am begining a django project and want to use MySQL instead of SQLlite. > So, I watched a video to learn how to use MySQL with Python. VBased on > that, I was able to install MySQL into a C:\MySQL directory successfully. > I also created a database with userid(root) and password. Then I wrote a > Python program that read in a CSV file, created a table in the same > database and then INSERTed the rows into the table. Also needed to 'import > mysql.connector'. Using SQL Workbench, I was able to verify that all was > successful. > Next I tried to access this database from Django without success. Here's > what I did. First I created a virtual environment and then activated it. > Next, ran 'django-admin startproject <kprojectr name> . This created the > settings file, but it is set up for SQLlite. I edited this file to change > these parameters: > DATABASES = { > 'default': { > 'ENGINE': 'django.db.backends.mysql', > 'NAME': 'gammon', > 'USER':'root', > 'PASSWORD':'1ltarty#', > 'HOST': 'localhost', > 'PORT': '3306', > I skip the 'migrate' step. Next was 'python manage.py runserver. This > failed. I got many error message which I saved in a text file. At the > beginning of the messages MySQLdb could not be imported as it couldn't be > found. Neat the end of the errors, there is a message asking if I had > insjtalled mysqlclient. > I have researched these two errors without much success. I tried to > install MySQLclient, but always get a message that the requirement was > already satisfied. I cannot find any module MySQLdb anywhere on my PC. I > think these two areas are related. Since I am able to use MySQL with > vanilla Python successfully, I suspect I have a PATH error perhaps. > I am now at a loss as to what I might try next. Does anyone have any > ideas? All comments appreciated. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/d4b3ffa0-cab7-473e-8615-993b4aac4609%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/d4b3ffa0-cab7-473e-8615-993b4aac4609%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAJ0m4xhTytpwEKqTiaiVyx%2BQ4%2Bp2g%2ByHBiiidanuCZVU7T1W%3DQ%40mail.gmail.com.