Replies: 1 comment
-
I think the neater way is to use nested routers right? We have a central app for configuring our api and setting up all of the error handlers, and auth. It's also a place to store any api utils. Then any app has an api folder, which contains a python file for each set of concerns. These all define routers, then in the init.py just import all the routers from this app and make one app wide one. Then in the Here's the docs: https://django-ninja.rest-framework.com/guides/routers/?h=nested+routers#nested-routers |
Beta Was this translation helpful? Give feedback.
-
The docs do not contain info about how to breaking up django-ninja views. That's needed e.g. if you want to consolidate the APIs of separate Django apps into an API for the overall Django project.
The solution suggested (exemplary Django app
core
) is:Import
views.py
intourls.py
before callingapi.urls
inurlpatterns
:Beta Was this translation helpful? Give feedback.
All reactions