by po · 13y ago · 0 comments
Even better, when you hit the API with a browser, you can click around and explore the links easily:
http://restframework.herokuapp.com/users/
The docs talk about it a bit here:
http://django-rest-framework.org/tutorial/5-relationships-an...
So,
…
{
'id': 123,
'url': '/resource/123'
},
…
instead of …
'/resource/123',
'/resource/124',
…
or worse …
123,
124,
…
Also, Django REST Framework is easily my favorite REST API tool for Django. It's very straightforward to use just as much or just as little of it as necessary. In fact, it's powering the main views of the upcoming second draft of http://marquee.by (the entire site is effectively a browsable API).