submarcos / django-vectortiles

Mapbox VectorTiles for django, with PostGIS or Python
https://django-vectortiles.readthedocs.io
MIT License
38 stars 11 forks source link

PostGIS backend uses connection the DB provided by get_queryset. #40

Closed kxtells closed 1 year ago

kxtells commented 1 year ago

This is made to not assume that the default db is the one always used.

In my use case we're keeping a Django application in two modes tile server and application server and then, depending on the deploy we'll use one or another.

For this to work we configured two databases in django, default refers to application and vtiles to the DB storing all the features for tiling.

This change ensures that if we provide the queryset with a using(Dbname) the end query ends up in the proper database.