5👍
✅
Setting DATABASE
section in the settings.py
with OPTIONS – charset solves this issue:
# Database
# https://docs.djangoproject.com/en/1.10/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'myproject',
'HOST': 'mysql',
'USER': 'django',
'PASSWORD': '******',
'OPTIONS': {
# !!!!!! THIS MATTERS !!!!!!
'charset': 'utf8mb4',
}
},
}
See documentation: https://docs.djangoproject.com/en/1.10/ref/settings/#charset
Source:stackexchange.com