I don’t have a specific need to do this at the moment. I’m just curious what would be the best way to make it so that:
example.com/cars/honda/ — Would perhaps return a car template page with pics and info about Hondas
example.com/cars/honda.json — Would return a JSON object with Honda info
Any ideas?
Typically, with RESTful APIs, this sort of thing is handled with content type negotiation. I haven’t used it, but Django REST framework can provide content negotiation.