Django with mysql By pyMYSQL
Work on less than 3.0.8
PyMySQL
virtualenv -p python3 env
. env/bin/activate
req.txt
asgiref==3.2.10
Django==3.0.8
PyMySQL==0.10.0
python-decouple==3.3
pytz==2020.1
sqlparse==0.3.1
Database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'dbname',
'USER': 'username',
'PASSWORD': 'password',
'HOST': '127.0.0.1',
'PORT': '3306',
}
}
Add this line in __init__.py
import pymysql
pymysql.install_as_MySQLdb()
Comments
Post a Comment