I LOVE how you spent most of the tutorial showing the explicit but repetitive way of doing it. What makes me stuck with Django REST Framework is that there is too much "magic" going on. It's so important to see how it works in details when we're not using ModelSerializers or other magic classes.
This is my first video on this channel..subscribed to your channel. What an underrated channel!! You deserve millions of subscribers. I am going to watch your videos..
Am a frontend developer, but just started backend (django) late last month. I must confess this is the third video tutorial have gone through on RUclips on Django, but this very one is top notch. Thanks for sharing. I will be glad if you can also share authentications (register and login) as well. Thanks a bunch
you explain every things very well. after tried lots of premium and youtube docker tutorial, finally your docker crash course make things easy for me. Please make a nodejs microservices tutorial with kafka if possible.best wishes
Any chance you’d be able to please make a react pagination video, where the data is coming from an api but also include a search bar in the same project?
thank you, everything you have done happens in the api. what about the real app?. consider someone who already has a django app, and they want to create an api to tinker with it. what changes can they make on this your code
If you pass a wrong id while fetching against id it will trough an error. It will not work with get_by_pk function if but If your try this method it will work perfectly because it's returning from the above function and after it will be inside get function to try this method. Thanks def get(self, request, pk): try: book = Book.objects.get(pk=pk) serializer = BookSerializer(book) return Response(serializer.data) except: return Response({ 'error': 'Book does not exist' }, status=status.HTTP_400_BAD_REQUEST)
The get_book_by_pk function returns the error response to the get function, instead make the get function return the error response. class putpostdelete(APIView): def get_book(self,pk): try: book = Book.objects.get(pk=pk) return book except: return 1 # return Response({ # "Error":"Book does not exist" # },status=status.HTTP_404_NOT_FOUND)
def get(self,request,pk): book=self.get_book(pk) if book==1: return Response({ "Error":"Book does not exist" },status=status.HTTP_404_NOT_FOUND) Smoething like this.
From where is the create() method (at this timestamp: ruclips.net/video/mlr9BF4JomE/видео.html) in the Book model called? I didn't see it anywhere in the code.
This video is so hard to follow. Immediately after typing new code, you switch to a different file, so the viewer has to rewind the video if they didn't type everything that you just typed, down to the second. When you refactor, why are you doing that? What are the benefits and disadvantages? After we refactor using APIView, your justification is "I like that a whole lot better." These aren't legos or a painting of a lake, it's logical code and knowing the WHY matters a ton, especially if we're refactoring something for the third time.
For those who are confuzed about why the PUT mehtod acting like a POST in the section of "Class View" One return is missed in the demostration, it should be like this(I have my own variation repalced book with picture): def get_picture_by_pk(self,pk): try: picture = Picture.objects.get(pk=pk) return picture
except: return Response({"Error":"picture not found"},status=status.HTTP_404_NOT_FOUND)
I LOVE how you spent most of the tutorial showing the explicit but repetitive way of doing it. What makes me stuck with Django REST Framework is that there is too much "magic" going on. It's so important to see how it works in details when we're not using ModelSerializers or other magic classes.
This is my first video on this channel..subscribed to your channel. What an underrated channel!! You deserve millions of subscribers. I am going to watch your videos..
Am a frontend developer, but just started backend (django) late last month. I must confess this is the third video tutorial have gone through on RUclips on Django, but this very one is top notch. Thanks for sharing.
I will be glad if you can also share authentications (register and login) as well. Thanks a bunch
Best explanation on Django API I have come across on RUclips. Thanks for sharing
was struggling to undertand django after buying a course, if only i had seen this video, loved the detailed explanation, great job
love the way you teach. So calm and easy. Even if my native language isn't english, I can fully understand you. Love from Pakistan.
Thanks
This was a really good, concise and accurate course. Thanks!
you explain every things very well. after tried lots of premium and youtube docker tutorial, finally your docker crash course make things easy for me. Please make a nodejs microservices tutorial with kafka if possible.best wishes
This is a great tutorial.. I was looking for a quick tutorial and this one is just right.
Great tutorial as always!!!
Any chance you’d be able to please make a react pagination video, where the data is coming from an api but also include a search bar in the same project?
Thanks a lot for the amazing course!
subscribed sir..wont say much..but u cleared everything thank you.
you make it really simple! thank you so much
Awesome video, thanks so much.
I like this, very clear
Thank you for this video! It was awesome =]
need more django tutorial such as auth
thanks for the tutorial. it was very helpful.
Thank you so much for the amazing content 👍🙏🤝👋🫡👌🫶🏻✌️👏🏻😎👌🫶🏻
Your repo does not have the code pushed. main branch only without any of your code.
thank you, everything you have done happens in the api. what about the real app?. consider someone who already has a django app, and they want to create an api to tinker with it. what changes can they make on this your code
Excellent tutorial, very thanks
OMG! Thanks so much!
Hi, what if i want to update only one field? For example I want to update description of id "1"???
Terima kasih. Sangat membantu
Great tutorial!
Very helpful thanks a lot !
Great tutorial
Nice tutorial.
Please what about authentications
When should I use viewsets instead of views?
If you pass a wrong id while fetching against id it will trough an error. It will not work with get_by_pk function if but If your try this method it will work perfectly because it's returning from the above function and after it will be inside get function to try this method. Thanks
def get(self, request, pk):
try:
book = Book.objects.get(pk=pk)
serializer = BookSerializer(book)
return Response(serializer.data)
except:
return Response({
'error': 'Book does not exist'
}, status=status.HTTP_400_BAD_REQUEST)
Thank you! Was wondering what was wrong with my code, but this helped.
I will be glad if you can also share authentications (register and login) as well. Thanks a bunch
On next video, try to do Web3, Blockchain course
the code is not available in the repo. can you update it.
Very helpful for a beginner. Please do authentications and authorizations too. Needed urgently
thank u very much
Hello, working with the get by pk function does not work when the id is not in the database, it returns an atribute error page
The get_book_by_pk function returns the error response to the get function, instead make the get function return the error response.
class putpostdelete(APIView):
def get_book(self,pk):
try:
book = Book.objects.get(pk=pk)
return book
except:
return 1
# return Response({
# "Error":"Book does not exist"
# },status=status.HTTP_404_NOT_FOUND)
def get(self,request,pk):
book=self.get_book(pk)
if book==1:
return Response({
"Error":"Book does not exist"
},status=status.HTTP_404_NOT_FOUND)
Smoething like this.
Can we have the Source code for reference?
awesome
From where is the create() method (at this timestamp: ruclips.net/video/mlr9BF4JomE/видео.html) in the Book model called? I didn't see it anywhere in the code.
this api working for integrating in flutter
Integration of Chrome extension and api calls plase
lol you r the goat
code ? коде ?
This video is so hard to follow. Immediately after typing new code, you switch to a different file, so the viewer has to rewind the video if they didn't type everything that you just typed, down to the second. When you refactor, why are you doing that? What are the benefits and disadvantages? After we refactor using APIView, your justification is "I like that a whole lot better." These aren't legos or a painting of a lake, it's logical code and knowing the WHY matters a ton, especially if we're refactoring something for the third time.
Lala iz banata
For those who are confuzed about why the PUT mehtod acting like a POST in the section of "Class View"
One return is missed in the demostration, it should be like this(I have my own variation repalced book with picture):
def get_picture_by_pk(self,pk):
try:
picture = Picture.objects.get(pk=pk)
return picture
except:
return Response({"Error":"picture not found"},status=status.HTTP_404_NOT_FOUND)
Very helpful thanks a lot !