What is the common convention for supporting multiple representation (e.g. html, json, xml) for resources (e.g. blog, user) in django?
First, I don't know how I should format my urls. For example, what your take on using either of these urls to request xml format
/<resource>.<format>
, e.g./blogs/123.xml
/<format>/<resource>
, e.g./xml/blogs/123
/<resource>?format=<format>
, e.g./blogs/123?format=xml
Should I just rely on the Content-Type
passed parameter? What about having multiple mobile representation (e.g. iphone, mobile, palm) and full browser representation?
What about views? What's the convention for choosing the right templates without having a lot of if statements or much duplicate code.