I've created a serializer and ViewSet for my model and added a template for a list view. To get to see the web page (template) the ordering render classes must be correct and one needs to add the TemplateHTMLRenderer
to the list of renderers.
This now leads to the issue that when wanting to browse to a specific record like
/mymodel/5
in the browser, I get shown the list view too.
The goal is to have 1 url that serves the api (json) or the web page both for list and detail views. (/mymodel = list, /mymodel/5 = detail)
The question is: how can I have multiple templates (list/detail) based on one ViewSet?