dj-database-url: heroku+django+mysql: sslmode not supported.

Based on docs: there’s no ‘sslmode’ attribute. The following code gives me the exception: 'sslmode' is an invalid keyword argument. This issue is possibly related to other backends like sqlite as well.

Workaround: On settings.py after: django_heroku.settings(locals()) add: del DATABASES['default']['OPTIONS']['sslmode']

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Reactions: 37
  • Comments: 16 (3 by maintainers)

Commits related to this issue

Most upvoted comments

I got this error: del DATABASES[‘default’][‘OPTIONS’][‘sslmode’] KeyError: ‘OPTIONS’

Thank you very much !

fwiw it looks like 'OPTIONS': {'ssl': True} is needed for mysql instead of 'OPTIONS': {'sslmode': 'require'} for postgres ref https://stackoverflow.com/q/59894554

To fix this error, just use

django_heroku.settings(locals())

At the end of the line, No need adding

del DATABASES['default']['OPTIONS']['sslmode']