Posts

Showing posts from September, 2020

Django with Mysql by mysqlclient

sudo apt-get install python3-dev libmysqlclient-dev python3 -m pip install mysqlclient virtualenv -p python3 env . env/bin/activate pip3 install django pip3 install mysqlclient OR Update it pip3 install -U mysqlclient django-admin startproject mysite .

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()