I want to force Django to use SSL to connect to my postgres database.
This question indicates that I need to pass sslmode='require'
to the psycopg2 connect call. How do I add this to Django's database paremeters?
I want to force Django to use SSL to connect to my postgres database.
This question indicates that I need to pass sslmode='require'
to the psycopg2 connect call. How do I add this to Django's database paremeters?
If you're using dj_database_url you can pass
ssl_require=True
which sets the option for you.Add
'OPTIONS': {'sslmode': 'require'},
to your database config. For example: