Django Rest Framework Series - Viewsets and Routers with React Front-end Example - Part-4

preview_player
Показать описание
Hello, we are back again for the forth tutorial in this Django Rest Framework Series. In the following series of tutorials we will go through the Django Rest Framework and in addition build a React application to consume our Django Rest API. In this tutorial we introduce Viewsets and Routers within the Django Rest Framework and continue building the React front-end to build a single post component

🎉More from this Django Rest Framework Series:

🐱‍🏍Introduction
00:00 Welcome and introduction
02:42 Problem we are trying to solve
04:35 viewset.Viewset introduction
15:06 Creating Routers
20:59 ModelViewSet
24:54 Customising ModelViewSet
🐱‍🏍React Development
32:03 Building a single post view in React

Code Repository:

👍SUBSCRIBE to get more free tutorials, courses and code snippets!

👍👍Follow us on Facebook

👍👍👍Follow use on Twitter:
Рекомендации по теме
Комментарии
Автор

I 100% agree with you on the part where you said lots of tutorials just teach you one specific way but DOES NOT tell you what else is possible. Bravo to you for doing this. Love the theory part of every video.

jasonliu
Автор

Another nice one... also let me just say I love that you don't edit the video to fix mistakes, and instead debug them only once you notice them. Several times now I've spent an hour or so debugging one of the issues that you fix 10 minutes later in the video, and it has always helped me to get a better understanding of the code.

MrKeepItTrill
Автор

Hi Sir, thank you for amazing series, I have a small problem, I can get the single posts using title or I'd but slug doesn't work, it says no entry with that data, I have checked all my files but I can't fix it

mohsenansari
Автор

Really thanks for the great tutorial, I have a question please, can I use Generic views with the router instead of using Viewsets?

shn
Автор

Hey there, great video! I'm wondering how to write a viewset 'create' and an associated serializer. Do you have a video on this?

ryancadby
Автор

Thanks for video! I have one question about "def get_object" method. If I have several "item" which i want to get when i add some path to urls. For example I have three " 'title': 'new' ". How can I get them in one URL, if methog "get_object_or_404" return 1 object? Thank you.

serioussam
Автор

Just curious. In urls, we did not specify <slug:pk>, does it matter?

jiweihe
Автор

hello, when i tried logging in at the end of this tutorial and i got this error: Unhandled Rejection (TypeError): posts.map is not a function

markchukwuebuka
Автор

Hello how can we get the user information using refresh or access token sir?

Sasuke-pxkm
Автор

is that slug field auto generated or i have to fill manually?

bibekpaudyal
Автор

Hello, please I'm having problems with this, I'm having problems getting the slug into the useEffect, it displays warning and doesn't load the posts eventually. Any solution would be appreciated.

onajifortune
Автор

Thanks. This is what I have trouble with. <3

whichdude
Автор

I have an erro on part 3 login form. It says unauthorized: /api/token/. How can I fix it? Please help

alvinemulo
Автор

Hi, I was not able to post the data in 127.0.0.1:8000/api when I created viewsets.ModelViewSet in blog_api and getting integrity error and Exception Value:

FOREIGN KEY constraint failed

satishkurakula
Автор

I'm getting deadlock error, maybe because of Defaultrouter actually I'm doing this,
router = DefaultRouter()
router.register('job/intermediator', FreelancerJobIntermediatorView,
urlpatterns = router.urls
url_list = [
path('2'/, bla.as_view()),
path('1/', bla2.as_view()),
]
urlpatterns += url_list

nikhilbhardwaj
Автор

hey, how is your Link working in the posts.js function? Link doesn't have "href " property, instead it has "to" property. mine wasn't working i had to change it.

siddharthshukla
Автор

Hi bro how we can test modelviewset views test with django test???

hamedmohammadi
Автор

Hi, How Can I make this but having automatically the client_id and client_secret?

sergiaguilar
Автор

​ @veryacademy . I can't understand the difference between listing and retriving data

shreymittal
Автор

An Axios component with a different URL than '/' produces an error during login. I'm getting deadlock error, maybe because of Defaultrouter actually I'm doing this,
router = DefaultRouter()
router.register('job/intermediator', FreelancerJobIntermediatorView,
urlpatterns = router.urls
url_list = [
path('2'/, bla.as_view()),
path('1/', bla2.as_view()),
]
urlpatterns += url_list

GinesLA