2 min read.
I'd like to share some of the insights of the talk, the slides and other useful resources to get started developing API's.
What's an API
The first part of the talk was dedicated to explaining what an API is, and why it would be useful for us to create one.
Its use may vary, but most likely they're used to allow third party apps to use our content and embed it in widgets.
What is REST
Django Rest Framework
After we finished, it was time for questions, one of the featured questions was:
Q: Should we build our web apps as an API and have somethings in frontend to communicate with it like Backbone?
A: In general, we should have in our apps functions and shortcuts that allow us to get and return JSON data very easy and on the other hand, it is important to abstract functionalities that we are repeating in several parts.
So my recommendation in
Django is to have regular views, and start building our API as we add more and more AJAX calls, also, to have in mind that if we're repeating something more than two times, we should probably convert it to a function, or abstract it some way.
In this was, we won't have worry about building a whole API at the beginning of the project, but rather we'll be building it on the go.
Nevertheless, this technique may not work if you want to create a public API in which case it's better to architecture it before building it.
Generic Views Overview
Todo's App Demo
Networking And Food
In conclusions, having an understanding of what an API is can come in handy and when developing and can prevent us from repeating ourselves. Following, there are some resources that might be useful to get you started with API design.