Skip to content

Instantly share code, notes, and snippets.

@skabbit
Last active August 16, 2019 08:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skabbit/7d020028908c64c3b2599eb5e0a051b6 to your computer and use it in GitHub Desktop.
Save skabbit/7d020028908c64c3b2599eb5e0a051b6 to your computer and use it in GitHub Desktop.
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',''));"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment