Hey Marvin Kweyu, if we don’t pass any options into dj-database-url, then it won’t create that key. Hence, your error.

Maybe a better approach would be:

options = DATABASES['default'].get('OPTIONS', {})
options.pop('sslmode', None)

I’ll update that section of the article so it’ll work no matter what options people use. Thanks for pointing it out!

Top writer in Technology | Backend Web Developer | bennettgarner.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store