Django: I have a question about making an API in Django

Viewed 47

guys!

I'm doing a test that asks me to make an API and I don't have experience with that.

The test says:

"In order for us to know who the debtors are, the status of their credit recovery and more information, create an API to save and provide information about the cases and the people involved(credtors and debtors)."

I'm confusing about the "to save" part. Do I have to make routes to save new creditors, debitors and cases, or the admin panel of Django is responsible for that and I have to just create routes to return information about the cases, creditors and debitors in json?

1 Answers

Yes, you should create a route which allows to make a POST request. You can save new creditors, debitors and cases to your model by this. Also you can create a route which makes a GET request, you can get list creditors, debitors and cases informations and their single object details.

You can do this easily by Django Rest Framework.

DRF quick start project helps you to understand. For details: https://www.django-rest-framework.org/tutorial/quickstart/

To build your own project(custom models, serializers, views, etc.) you can follow tutorial series: https://www.django-rest-framework.org/tutorial/1-serialization/

Related