Creating a CRUD API with Django-Ninja #3 - Creating POST, PUT and DELETE Routes

preview_player
Показать описание
In this video, we will create three new API routes using django-ninja - a nice alternative to Django REST Framework that is heavily inspired by the FastAPI web framework.

We will create:
1. A route to create a NEW track in the database (POST request)
2. A route to update an existing track in the database (PUT request)
3. A route to delete an existing track in the database (DELETE request)

☕️ 𝗕𝘂𝘆 𝗺𝗲 𝗮 𝗰𝗼𝗳𝗳𝗲𝗲:
To support the channel and encourage new videos, please consider buying me a coffee here:

▶️ Full Playlist:

𝗦𝗼𝗰𝗶𝗮𝗹 𝗠𝗲𝗱𝗶𝗮:
Рекомендации по теме
Комментарии
Автор

Awesome videos. Not too long, but precise and good exaplained. Thank you for that.

In your delete request you still have the data object in your function definition, which is not needed and never used. Took a quick look at the blog article where it is not mentioned.
Just as a hint for future viewers who are wondering at first

arrensen
Автор

This tutorial is as great as the bands you chose for your examples :)

alvaroandresherradacoronel
Автор

can´t wait for more ninja videos, great content as usual!

peterholzer
Автор

Try For the update, instead of looping through the attributes, try: And howcome with delete it did not complain that data was not provided, its not optional, and you did not post a body.

mangelozzi
Автор

Hi awesome vid bro, This is a clear cut, vid found related to django ninja. I like to ask you a favour. I stuck with an issue while using post method through ninja api. The issue is, I have to hit an external API and the input for that API have to come from React frontend. I have no idea how to get the post inputs from frontend coz in case, if it is django Rest, I can get the data through "request.data". But in django ninja how to process the React front end data in django backend. Do you have any Idea?

siddhartht