Router register viewset with empty string as prefix conflicts with other viewsets #9204
Unanswered
arsanysamuel
asked this question in
Potential Issue
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have 2 viewsets that I want to register with a router, one should be accessed using the root path of the router and the other should have a prefix.
urls.py
routers.py
main/
works fine but when I try to accessmain/sub/
it returns 404, it only works when I populate the prefix string as follows:Then I can access the main viewset using
main/main/
and the second viewset usingmain/main/sub/
which is not the desired path, am I doing something wrong or it should work with an empty prefix?NOTE: I'm using a main
urls.py
file in the main app which imports and adds the aboveurls.py
Beta Was this translation helpful? Give feedback.
All reactions