Bennett Garner
1 min readAug 1, 2020

--

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!

--

--

Bennett Garner
Bennett Garner

Written by Bennett Garner

DeveloperPurpose.com — Build a coding career with meaning and purpose 💻 Top writer in technology ✍️

Responses (1)