Join my free course on building a Todo API with Django REST Framework: prettyprinted.com/djangotodoapi
@Iamkabera4 жыл бұрын
Two years late, but this is one of the most useful resources I have come across.
@juandiegocastanogomez38544 жыл бұрын
Single Handedly the BEST video series on Django Rest Framework I've ever seen, and seen them all on KZbin, Udemy, etc. Concise, technical but just enough vanilla. Can't fully express my gratitude. This tutorial is so good that even though I have a student budget (haha) Iḿ really considering buying your courses. PERFECT!
@simplyajith14 жыл бұрын
True, this is the core and wasted some 40 hours in udemy.
@SatyamSingh-hz9su4 жыл бұрын
Can you drop the playlist link
@bcaclassesnepal1992 Жыл бұрын
Thank you for this please keep on posting great videos like these.
@asiddiqi1234 жыл бұрын
Watched so many drf related videos, no one was as clear as you.
@swadhikarc78585 жыл бұрын
Awesome explanation. To those who get 'rest_framework.serializers' has no attribute 'HyperLinkedModelSerializer' error, this is due to the ModelSerializer itself handles the hyperlink url in the latest versions of rest_framework. Therefore, in the serializer class, you may inherit from ModelSerializer itself like class ParadigmSerializer(serializers.ModelSerializer):
@prettyprinted5 жыл бұрын
Thanks!
@abhishekamin30905 жыл бұрын
ModelSerializer seems to bring the urls for its own model and will not work for fields such as ForeignKey which are mentioned in a different model.
@BohdanDuCiel3 жыл бұрын
You might not know it! But you saved me a lot of research on my bachelor project, thanks a lot
@kiranp454 жыл бұрын
Thanks a lot man... Lots of love from India
@gaikwadabhishek6 жыл бұрын
Hi, I love your Django Series. I'm not able to understand how to use authentication and authorization with Rest framework. Can you please help me with that!
@giovanniaravenam914 жыл бұрын
Why the dropdown of the foreign keys of the 10:07 minute does not appear to me? I am using the following versions: Django = 3.0.4 djangorestframework = 3.11.0 djangorestframework-jwt = 1.11.0 psycopg2-binary = 2.8.3 (for Postgresql) gunicorn = 20.0.4 pyjwt = 1.7
2 жыл бұрын
hi, I had same problem while, you have to add field to your LanguageSerializer class fields = ('id', 'url', 'name', 'paradigm')
@raghavarahulkalavala15424 жыл бұрын
Hi, I liked your video. I have a question for you. Based on the above example that you have shown, instead of many to many relationships, one to many relations works more good right? Because its also like one programmer can have multiple languages
@vinodsagar24125 жыл бұрын
Hi..... you are just awesome, one of the best explanation in youtube on REST FRAMEWORK.... thanks a lot
@prettyprinted5 жыл бұрын
You're welcome! Thanks for watching!
@jhoanmartinezsilva26094 жыл бұрын
wowww, great work, amazing, huge thanks
@spatialnasir2 жыл бұрын
Thanks for this useful explanation.
@moshfiq6 жыл бұрын
It is so assuring to see someone else is having problem with typing serializers too. I feel you bro. 8:03
@prettyprinted6 жыл бұрын
lol! I'm terrible at typing words I never use outside of programming.
@akshaychauhan5454 жыл бұрын
You're awesome man 🙌
6 жыл бұрын
Great man, keep continues excelent videos, thanks.
@prettyprinted6 жыл бұрын
I won't stop! Thanks for watching.
@branquitodemunze6 жыл бұрын
How would you manage voters-polls, as many to many, but in a such way, that voter can do a certain poll only once? When a new poll is created, would you first immediately add all existing polls to him, and how would you set voted flag on a pivot table, so that he wouldn't be able to vote again on that particular poll. Thanks.
@moltenaluminium4 жыл бұрын
Using your example, Could you get a list of languages based on the paridigm? Something like GET /languages?paradigm=1
6 жыл бұрын
Please make a course on your website about Django Rest Framework, including as much as you can... I'd buy it definitely.
@prettyprinted6 жыл бұрын
That's part of the plan. Hopefully I get to it within the next few months.
@vinay__baliyan4 жыл бұрын
If I may ask, would it be possible to views programmers tagged to each language like we have languages displayed for each programmer?
@alysonbrito6945 жыл бұрын
Great video! Could you please show me how to create resources using postman or any other type of client? The browsable api sometimes seems too "magic" for me.
@vinayaksinghsendhaw89033 жыл бұрын
How do i change the colour of my api ..? Any idea !
@DeViLTh0rn5 жыл бұрын
I get Assertion error, after adding ForeignKey, "should either include a `serializer_class` attribute, or override the `get_serializer_class()` method." what should i do?
@michaels9734 жыл бұрын
is there a way to print the language name when viewing the programmer? Rather than the language id or url?
@ZainAli-me4qk5 жыл бұрын
Thanks man for great tutorial
@wechulipaul4 жыл бұрын
Wow, this was so clear !
@prettyprinted4 жыл бұрын
Thanks for watching!
@farshadbadiee71335 жыл бұрын
thanks for the great series of tutorial . but one question what will happen if we want to add a many to many between 2 models and some how make a third model for making the relation between them ??
@prettyprinted5 жыл бұрын
I don't understand what you mean. Are you trying to use the third model as the model that will hold the data from both tables, or do you want a third table to related to one of the first two in some way?
@farshadbadiee71335 жыл бұрын
@@prettyprinted actually yes third table to join the other 2 tables in laravel we call it pivot table and its responsible for many yo many relationships :)
@prettyprinted5 жыл бұрын
@@farshadbadiee7133 What Laravel calls a pivot table Django does automatically. Since pivot tables are very simple, there's need to specify them directly in Django.
@farshadbadiee71335 жыл бұрын
@@prettyprinted Thanks For great answer do you have any plan to make any toturial about many to many realtionships ?
@prettyprinted5 жыл бұрын
@@farshadbadiee7133 I will eventually.
@gauravswarankar25573 жыл бұрын
can i get the link of this project api. m not geting on your github or any below link.
@rahulvanmali14066 жыл бұрын
Thanks brother! For django rest framework
@prettyprinted6 жыл бұрын
You're welcome! Thanks for watching.
@yahyakharrazi41766 жыл бұрын
Thanks for the very helpful videos! I'm working on a page it has a form and inside it has many comboboxes containing data from each tables, I created for each table in my database a serializer class and a view to retrieve data from each tables, the problem is while I load this form page it takes a while to load. So i'm guessing if there's a way to join unrelated models
@askhatarslanov63276 жыл бұрын
Maybe select_related or prefetch_related can help you.
@iancarr39236 жыл бұрын
Again very useful - thanks.
@prettyprinted6 жыл бұрын
Thanks for watching!
@jayceazua7235 жыл бұрын
I'm having an issue: instead of using sqlite3 I am using postgres, however whenever I try to use the MyModel.objects.all() it simply states that my model does not have a property or method named objects.
@prettyprinted5 жыл бұрын
What is the exact error text?
@kyojindev39786 жыл бұрын
if there will be 2 k languages, how to make pagination on it?
@prettyprinted6 жыл бұрын
I'll probably make a video to cover this, but check this out: www.django-rest-framework.org/api-guide/pagination/
@kyojindev39786 жыл бұрын
pagination inside json item? { 'album_name': 'The Grey Album', 'artist': 'Danger Mouse' 'tracks': [ {'title': 'Public Service Announcement'}, {'title': 'What More Can I Say'}, {'title': 'Encore'}, ............ 1k ], }
@maxennybee6 жыл бұрын
hi love your videos. i have a question. how would you handle a self referencing model with a many to many relationship?
@prettyprinted6 жыл бұрын
You use quotes. Like this: stackoverflow.com/questions/15285626/django-self-referential-foreign-key
@maxennybee6 жыл бұрын
@@prettyprinted Thanks once again. While this is very helpful for me and is what i might actually redirect to, however, i was looking as something like this that has many relationships e.g custommodel = models.ManyToManyField('self', through='JoiningTable', symetrical=False). Django doesnt populate the joining table or how do i get to do that with the api.
@maxennybee6 жыл бұрын
@@prettyprinted Also while trying that option, will i allow null=True ? especially for records that dont have a parent_id
@prettyprinted6 жыл бұрын
@@maxennybee Yeah, if you don't expect each record to have parent, then you want null to be True.
@o___o45975 жыл бұрын
Thanks a lot for your tutorial!
@leewilliam86066 жыл бұрын
Hi,you really teach very well!Could you teach something about filter?
@kmasoftwares43034 жыл бұрын
How t add status code and a message to the output json array
@celiahassaine77884 жыл бұрын
I kinda followed u step by step but i get an error cause of the hyperlinkedmodel........." Could not resolve URL for hyperlinked relationship using view name", why do i have this error when i have followed the same steps as he did meh
@kristoffergonzaga55315 жыл бұрын
Hi, I would just like to ask why my languages field in kzbin.info/www/bejne/h3OcmHp7rN2rg5Y is not showing and just the Name field? Awesome video by the way!!
@kristoffergonzaga55315 жыл бұрын
But it works when I add the data via the admin
@jrmartinss4 жыл бұрын
And if I want to show the name of the language and its paradigm in programmers?
@PhuongPhan6 жыл бұрын
Loving your videos you have a new subscriber!
@prettyprinted6 жыл бұрын
Thanks for watching and for subscribers.
@TheShash10016 жыл бұрын
Can you make a video about overriding create and update for nested serializers?
@prettyprinted6 жыл бұрын
I'll consider that. Thanks for the idea.
@george47466 жыл бұрын
is there any way to add a non-model field in the serializer.
@prettyprinted6 жыл бұрын
You should be able to, but I haven't tried it yet. You may have to override the to_representation method. www.django-rest-framework.org/api-guide/serializers/#to_representationself-obj
@abirulezz6 жыл бұрын
Nice tuts! Can you please make videos on django AWS dynamodb?
@prettyprinted6 жыл бұрын
I'll add that to my list. Thanks for the idea.
@vic_shine6 жыл бұрын
Hey, Anthony, good video here! :) thanks. Can you make me understand when I must to set _on_delete_ param to CASCADE or PROTECT or something else? What are they doing? What’s choosing? More usage example are welcome (and good idea for next episode, btw)
@prettyprinted6 жыл бұрын
I'll make a video for that. But basically the idea to prevent invalid data. If you delete a part row, you must consider what happens to its children, and on_delete helps you with that. CASCADE simply deletes all the children. PROTECT stops you from deleting a parent when children exists.
@pilotandy_com6 жыл бұрын
Thank you! Your tutorials are great. Is there a way to change the hyperlink for the user to still take you to the user, but SHOW the username? Or show the language names known by each user? make it more human readable? i.e Bob/
@MusabbirMamun4 жыл бұрын
Good question. Can you please give the answer of your own question?
@serhii.chumachenko6 жыл бұрын
Nice job! Thanks!
@prettyprinted6 жыл бұрын
You're welcome! Thanks for watching.
@ALXG5 жыл бұрын
Amazing!
@PhucNguyen-bn9io5 жыл бұрын
Thanks for your videos ^^
@prettyprinted5 жыл бұрын
You're welcome!
@ikhsanrahman97035 жыл бұрын
nice, would you like to share some complex example ?. thanks in advance
@prettyprinted5 жыл бұрын
I definitely will make more complicated examples in the future.
@miraccan003 жыл бұрын
Thanks a lot it's helped me >.<
@tejasgajare5426 жыл бұрын
Can you please help me with Authentication and Authorization with Django Rest Framework?
@prettyprinted6 жыл бұрын
Videos on that are coming soon.
@vinceramces5 жыл бұрын
shouldn't be the languages not urls , but instead the object properties of the languages. so in a front-end app. we're going to fetch those urls 3x instead of 1? I think its better to have something like this { "languages":[ {"id":1, "name":"Java", "paradigm":{"id":1,"name":"OOP"} } ] }
@vinceramces5 жыл бұрын
got it. just add `dept=1` in the class Meta of the serialize model
@vinceramces5 жыл бұрын
but I lost the capability to post languages if add the depth
@ivonherms4 жыл бұрын
I can't read the code
@testtest-xg4bf3 жыл бұрын
от души братан
@BookOfSaints5 жыл бұрын
This was a good video, but it lacked practical use, such as making actual api calls on an application, even if a simple one, to demonstrate these concepts better.
@prettyprinted5 жыл бұрын
I'll consider making more realistic examples for this.
@skyblaze66872 жыл бұрын
dude it totally stupid part of video better u should remove two model table api cant work their (imagine if u create 3 and have instances different id ) probably when u click on api pk value it open on different id just assume id save differently foreignkey doesnt help u to give different id for exact model table