DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': '*', 'USER': '*', 'PASSWORD': '*', 'HOST': 'localhost', 'PORT': '3306', 'CONN_MAX_AGE': 0, # add this 'OPTIONS': { 'charset': 'utf8mb4', 'connect_timeout': 60, 'init_command': "SET sql_mode='STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'" } } } //This configuration has been working fine for me so far.