Skip to content

Instantly share code, notes, and snippets.

@skabbit
skabbit / settings.py
Last active August 16, 2019 08:03
Django+MySQL settings for fixing "incompatible with sql_mode=ONLY_FULL_GROUP_BY"
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
...
'OPTIONS': {
'init_command': "SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));"
}
}
}