The Django project I'm currently working on requires that I use a database router. However, the docs page on multiple databases doesn't specify whether a router should be defined in a routers.py file or if it should be stored in urls.py instead.
I've been finding a lot of conflicting information on this, especially when it comes to best practices (there are a lot of different sources, and none of them talk about database routers).
So I'd like to know: where should my database routers actually be declared, and if this is in a separate file, where within my project should this file live (or does it even matter)?
Thanks.
In the application directory. Using the Django tutorial as an example, polls/routers.py