Viewing posts tagged rest service web
Docker is a wonderful technology revolutionazing how to run microservices. You may have some experience with it or may not. I will show in this short post how to run a Docker container in Amazon Web Services(EC2) with your whole API in it. This trick is only useful for APIs or django projects that doesn't need to scale and doesn't really have too much traffic.
I have been programming professionally for 19 years now and it was always a pain to maintain the changes you do in your database prepared to be replicated in all the installations your application needed. Remember it was desktop software before so we needed to create programs that check the version of the database they were using and somehow upgrade the database to the new fields, tables, triggers, views, stored procedures, user defined functions etc, so the new software will be able to run without errors.
If you have been following the previous 3 posts you have now your API 'running'(not deployed yet in production) but you may need to allow your customers to understand your API. In other words, you documentation for your API. Today the winning in that space is Swagger and it can be used not only for Python and Django but almost for every web framework available today. It is Open Source so you can even contribute to the project if your language or framework is not yet supported.
Following with previous post we can go now to authentication and permissions.
In the previous post (http://www.restapibuilder.com/blog/how-to-create-an-easy-restful-api-for-a-simple-model/) I explained a little bit how to create a basic API for a City model. I used our home page in order to create the serializer, modelviewset and url needed to our first move.