[Solved] Django Error: django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.

1. Background

Because you want to change the default database of Django to MySQL, the following error is reported when starting the project

django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.

2. Solution

From the above results, it can be seen that the corresponding module cannot be identified, so the corresponding module needs to be modified __ init__.Py file

import pymysql
pymysql.install_as_MySQLdb()

Just start the service again

Read More: