Third Coding Week
So, this week was a quite enriching one as I had to design and code an API for cross communication within two Systers Projects- Portal and VMS. The API was something new and challenging as I needed to use the Django Rest framework for its implementation.
Firstly, I imported the necessary packages like JsonResponse and the api_view needed for the api following which I headed on to the urls and views. I created a simple url with a logical address : meetup/api/v1/request_meetup_data for the POST request to be sent. The post request would be the in the format : yyyy-mm-dd. The views were also designed in the most simple way possible where the meetup information of the specified meetups are stored in a list in ascending order an sent as a JsonResponse. All date of meetups scheduled after this particular date would be sent to VMS once summoned. I used Postman to test the post requests and the response generated. It’s interface looks somewhat like this:
After the recent 1:1 with Poojitha, I was asked to write tests for the API as the coverage decreased by a considerable 0.4%. So, my next week would be solely devoted to writing the tests which would again be something new for me.