Using Mount only for entirely independent apps? #1964
-
Can I have a "main" routes.py that mount together all the "folders" (for example "admin" and "auth"), and inside those there is a new folder (not entirely separate app) with it's own routes/views, and so on. Usually just separated based on "/admin/users/nnn" where "users" get's it's own folder. In the template that url would be For learning purposes I would like to know what you think? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yes, that's totally fine. Use Mount to mount apps or child routes: routes = [
Route('/', homepage),
Mount('/app-prefix', app=AnotherASGIApp)
Mount('/prefix', routes=[
Route('/', view),
Route('/another-one', view),
Mount('/level-2', routes=[...]),
])
] |
Beta Was this translation helpful? Give feedback.
Yes, that's totally fine. Use Mount to mount apps or child routes: