django-iam-dbauth
django-iam-dbauth copied to clipboard
Quick note how to make it work with dj-database-url
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
.