django-iam-dbauth icon indicating copy to clipboard operation
django-iam-dbauth copied to clipboard

Quick note how to make it work with dj-database-url

Open kojiromike opened this issue 3 years ago • 0 comments

Not really an issue, but someone may find this useful. If you want to use this with dj-database-url, add a scheme entry:

# settings.py
from decouple import config
import dj_database_url


dj_database_url.SCHEMES["postgres+iam"] = "django_iam_dbauth.aws.postgresql"
DATABASES['default'] = dj_database_url.config(conn_max_age=600)

and make sure your DATABASE_URL has the scheme postgres+iam and the query string use_iam_auth=true, something like postgres+iam://iam_user@rds_endpoint/dbname?use_iam_auth=true.

kojiromike avatar Dec 15 '20 16:12 kojiromike