What general convention supports multiple views (e.g. html, json, xml) for resources (e.g. blog, user) in django?
First of all, I don’t know how to format my URLs. For example, what do you assume using any of these URLs to request xml format
/<resource>.<format>, eg. /blogs/123.xml/<format>/<resource>, eg. /xml/blogs/123/<resource>?format=<format>, eg. /blogs/123?format=xml
Should I just rely on the passed parameter Content-Type? How about having multiple mobile views (e.g. iphone, mobile, palm) and a full browser view?
What about the views? What is the convention for choosing the right patterns without if statements or multiple code.
source
share