jazzband / dj-database-url

Use Database URLs in your Django Application.
https://pypi.org/project/dj-database-url/
BSD 3-Clause "New" or "Revised" License
1.49k stars 205 forks source link

psycopg vs. psycopg2 #230

Closed keikoro closed 1 year ago

keikoro commented 1 year ago

There is no way to use the package with the psycopg adapter rather than psycopg2, or is there?

Reason I'm asking is that the Django project itself recommends the former these days, when the latter has been the go-to standard for many projects for years now, I believe. They even make a note about how psycopg2 support will likely be dropped in the future.

I couldn't find anything about this anywhere in the docs, everything just seems to point to this project defaulting to psycopg2 for use with Postgres. What I did find after spending quite some time combing through old tickets was this PR: https://github.com/jazzband/dj-database-url/pull/26 – is the engine attribute a) an undocumented feature and b) what I'm looking for?

palfrey commented 1 year ago

So, this package just selects the Django DB backend. The Django backend then picks psycopg/psycopg2 based on what you've got installed which isn't anything to do with this project.

Admittedly, the engine param is undocumented and could do with fixing, but isn't needed in your case.