[Answer]-Query a secondary external database using a model

1👍

There is nothing inherently wrong with the solution that you have presented. The use of database routing is primarily for multiple databases that belong to your project. If you are using external databases (particularly ones over which you have little or no control), then the method you have shown is fine.

However, it is possible to wrap your external database such that it can be queried with the Django ORM. The docs cover this pretty well https://docs.djangoproject.com/en/dev/topics/db/multi-db/.

👤ebarr

Leave a comment