consbio / pg-database-utils

A suite of utilities for PostgreSQL database queries and operations built on sqlalchemy
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

`get_engine` fails when using GeoDjango database engine #1

Closed nikmolnar closed 4 years ago

nikmolnar commented 4 years ago

In order to use spatially-enabled Django models, the Django DATABASE settings must use django.contrib.gis.db.backends.postgis as the engine. However, pg-database-utils then requests a postgis dialect from SQLAlchemy, which fails with:

sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:postgis

Since this library is specific to postgresql databases, is it even necessary to get the engine/dialect from settings? Couldn't 'postgres` be hard-coded?

nikmolnar commented 4 years ago

Fixed by 208b8dad97e26523e3208c3bb1f87319f05ea85a