HyperlinkedModelSerializer fails when used with imported URL patterns #9091
Unanswered
vsoraas
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.
-
I've versioned my API manually, that is to say by declaring "v1", "v2", etc. patterns in separate files and importing them into urlconf. Usage-wise, this has not been a problem - until I tried using
HyperlinkedModelSerializer
, which went on to generate this:I'm not going to repeat the entire ordeal here, though I have a StackOverflow question & self-answer detailing it some for any who are interested, but at the end of it all it seems to me that DRF's Hyperlinked-classes cannot work in this scenario because the patterns of URLs that are imported into urlconf at runtime aren't available whenever
reverse()
is ran.reverse_lazy
doesn't help either.My estimation is that this is possibly a Django issue (or maybe a feature for all I know), but maybe there's a way to work around it in a DRF context?
Beta Was this translation helpful? Give feedback.
All reactions