Closed hbasria closed 5 years ago
Thanks so much for your work! However, I'm going to reject this for two reasons: (1) there's too much hidden behavior ("magic"), and (2) it's easy enough to do already in a more explicit way.
{FOO}_DATABASE_URL
and the lower-casing into settings.DATABASES
, there's a bit too much magic here for my taste.DATABASE_URL
is enough of a de facto standard that automatically parsing it makes sense, but there's a lot difference in how providers specify multiple databases. Given those differences, this patch may not work broadly, and if/when it breaks it'll be confusing (databases will just silently vanish).
DATABASES = {
"db1": dj_database_url.config("DB1_DATABASE_URL"),
"db2": dj_database_url.config("DB2_MY_PROVIDER_NAMES_THINGS_WEIRD")
}
This avoids hidden behavior, makes it clear where config is coming from, and (bonus) doesn't increase the code surface.
I'd (happily!) accept a documentation patch with the above, but adding this feature isn't something I think is appropriate.
Thanks again for your work, sorry to have to reject it.
Would love to see this feature.