Full Stack React & Django [1] - Basic REST API
HTML-код
- Опубликовано: 10 сен 2024
- In part 1 of this series we will setup a Django app and create a REST API with the Django Rest Framework. We will use Postman for API testing.
Sponsor: DevMountain Bootcamp
goo.gl/6q0dEa
Code:
github.com/bra...
Helpful Links & Tuorials:
www.django-res...
www.valentinog...
v1k45.com/blog/...
💖 Become a Patron: Show support & get perks!
/ traversymedia
Website & Udemy Courses
www.traversymed...
Follow Traversy Media:
/ traversymedia
/ traversymedia
/ traversymedia
The series is now complete. There are 7 videos total. Again, I encourage you to code along :) Final code is in the description
How long will this tutorial be?
@@Geomaverick124 Prob about 6 videos around 3 hours or so. Just an estimate.
Hey Brad, is it possible to become a web developer using your courses on udemy starting with the modern html and css? Your content is clear and of great quality. Thank you!
@@TraversyMedia thanks for the reply. I was asking so that i could prioritize my learning. I am focusing on taking courses or projects that are under 5hrs. I realized that when i do a project on youtube or udemy it takes me 3x as long...so i was seeing where i will place this series in my learning...
@@Geomaverick124 I wouls set aside 5 or 6 hours to complete. you have to account for errors and debugging, rewatching, etc
INCREDIBLE TIMING!!!! I'm 80% of the way thru your Django Udemy course and having a React + Django tutorial to go thru afterwards is going to be the icing on the cake!!!!!!!!!!
Been watching your videos and taking Udemy courses on web development for half a year. Used this video to prepare myself for the Backend technical interview. Yesterday I received an offer for a great job.
Much respect and love, Brad! You are doing an amazing job :)
I gotta say, man, I'm self-taught, and I haven't learned as much from anybody since the New Boston's Bucky back in 2013. Keep teaching; you're really good at this.
This is insane, I was planning to do a personal project with exactly this technology. Nice timing.
Thanks a lot for mentioning my tutorial Brad!
No problem, nicely done :)
Valentino, thanks also for your work. Brad did a great job in putting everything together, but your tutorial was a great input!
i have been searching all the way to youtube to get a better understanding of django-rest. but i believe this one satisfied my search! Hats off sir.
I have started this tutorial about two weeks ago, didn't uderstand much so I did some research. Learned some things about django, rest framework, redux and I am glad to be back here. I just love how you make it look so easy compared to others tutorials.
I stumbled upon your channel one day and that's the best thing I ever stumbled on. I took your udemy courses as well as eduonix ones and I always watch out for your developer resources & tips videos. I learnt a lot from you and have made a very humble try to teach concept based development in my new channel DevHoot. No matter, where I am I always return here for learning new things. Thanks for your good work.
I checked out your channel & to say it's humble will be an understatement. Keep up ur efforts & u'll surely get what u deserve.
Good to hear such stories. Always inspiring.
Wow what a timing, I'm a react developer and i know a lil bit of django so i just installed django REST framework to make some REST APIs for my react based self project. This is going to make my life more easier. Thanks a lot Brad :)
I think this tutorial is great but without reading the Django docs first I was so lost. I read the Django docs and came back and this tutorial's worth finally starting shining bright. Thanks Brad.
What section of the Django docs makes this video easier to understand? The documentation is too big and not sure what sections are important for this video.
I tried this but could not get far as it looks like everything is outdated. It would be amazing to make an updated project demonstrating building a lead management system with an endpoint ability that could plugin too, for instance, Zapier. (Pushing leads into the lead manager via Zapier or any other platform. I would buy such a course :-) Will be your first buyer! Thank you for all the tutorials! 🙏
This is honestly the best django tutorial I've seen, and I've done a bit of searching.
Beginner tutorials should be broken down into a simple way of thinking about it so they are easily digestible, and that's exactly what has been done here.
Thank you!
In case you are having trouble creating the virtual environment, run the command 'pip3 install pipenv==2018.11.26' instead of 'pip install pipenv'. That should solve the problem. Took me forever to find the solution to this.
This tutorial series is a GODSEND! Thank you so much Brad! This is everything I need for a large project I'm attempting currently.
This is one the best tutorials so far, I like your pace, some coders go so fast at 120 wpm and don't explain anything, you're the best!
Excellent series, also in terms of teaching the stuff, not only regarding contents. I could learn a lot and am very thankful. Will definitely checkout also your paid courses. I have only little recommendations:
- use browserrouter instead of hashrouter (I think nobody likes # in the URL)
- how to allow proper refresh when using browserrouter
- how to set up 404 etc. pages
- sometimes you could mention why you are doing something, that was not always clear to me, just one or 2 sentences would help a lot
- differentiate naming (using e.g. "leads" for all occasions is a bit confusing)
Thanks again and keep up the great work!!
I'm gonna love this series! plz, do a big project with Django/React/postgress this is an awesome stack!
How much great when you learn and teach some tech stack combinations i loved. You are gifted at decribing and teaching!
Just love YOUR Content Brad!!
Thanks :)
And just currently doing your Modern JS from the beginning
seriously Awesome!!!
Gift without the grift
Great Tutorial!!!
just a help info. In minute 20 you have a problem with the / slash at the end of the URL.
You can modifie this in settings file by writing:
APPEND_SLASH = True #so automatically the slash will be added if there is no.
Your videos are the very best out of all the youtube programming videos I have ever watched.
well designed and explained. I like how it starts with building the back end gradually and fully explains the steps. This tutorial is good for the junior developers who wants to dig into the react plus django setup.
thanks man these tutorials are so engaging because of the way you teach. you explain really well but show us by doing and much more engaging to listen to. this is awesome thanks
oh my god this is gold. So much better than other resources I was using
Very excited about this course, since I am kinda confused now of how to take the best of React and Django for one app.
Thank you so much, Brad!
Travesy ... where ever you are !! God bless you..
I have been looking for a course like this for ages. THANKS!
Thank you Brad for the awesome content! I have taken a few of your courses on Udemy and love your teaching style. I had been working on a Django backend and a React-Redux frontend project and this tutorial is exactly the resource I needed. Thanks again!
WOW! You just read my mind! I was researching for this combination yesterday! And here you are! Best as always
for windows users, you can have some problems :
-to check python version :
py --version
-to install pipenv:
py -m pip install pipenv
- to open the shell :
py -m pipenv shell
I am planning to replace express/mongo with python flask or django in future for react projects . right content from you . thanks brad .
Yes, finally. I've been looking for React/Django tutorial. You made my day, B.
Thanks, brad you're awesome! and I bought your MERN course on Udemy! This is really helping me get through school and understand the concepts! Don't know what students and developers would do without you.
Thank you Brad. Please make a series abou vue and django rest also please
Thanks man! I've been looking for this for a while!
after this Corona Lockdown I will be the master of universe thanks to you mr traversy
21:26 it was fun they you talk 😂, thank you so much for your efforts Brad, I learned a lot.
This is an awesome combination Brad!!! Thanks💟💟
You Are always on Brad's Channel Before me bro, I'm Jealous 😍😍😍
@@dammyola lol I have my notifications on for the channel that's why
sorry you've missed a line
on api.py for lead
We need queryset =>queryset = Lead.objects.all()
or it will print an error like that
Hey Brad, I just want to know that I really like your tutors and videos and I'm very thankful for them. peace and love from Iran
I really enjoyed all of your videos, they are all well designed and informative. I learned a lot from them and especially they are very well updated to the current modern web developing-designing technologies. Thank you so much. Hope to see more videos from you soon. Highly appreciated. :))
Brilliant, thanks Brad. Just what I needed. Can't wait to get stuck into this tomorrow. Yay!
All your courses are really nice and easy to follow. I finished the python, Django dev to deployment and I really wished you showed us how to load slugs instead to id in the url.
I really appreciate the effort you put in. You’re AWESOME brad👍
i'm following you'r advise and doing this API with vue.js.
by the way i love react. 🤣🤣
you are great sir on this planate
Just as I finished the Django and MERN Courses on Udemy, perfect fitting!!
Where have you been after all?? i found you like a treasure. Thumbs up and subscribed.
Ikr.. I found him recently after living in caves of confusions
Maybe revision of Django for 2019? Would love to see that.
2019 = django==2.2 stable
Yeeessss. I asked for it and I got it. Thank you so very much Mr Brad.
Very much love from Nepal... I am following you
Another great series that I cannot wait to watch. It's insane that you make these faster than I can watch them but I can't complain.
Ever considered a series on Microservices and/or Kubernetes?
Best tutorials so far!
Keep going brad, u doing cool stuff simply
Super, I know, what I'm going to do on (holidays) quarantine. Thank You, Maestro!
set trainling_slash to false at defaultRouter will avoid that little headache: router = routers.DefaultRouter(trailing_slash=False)
Thank you brad. You are the best
Your videos are awesome. If you could increase your font size a little so the text is clear that’d make it top notch. Thanks for spreading your knowledge and helping the community.
This is the path I want to go, React + Django. Can you please do more of these?
so cool. Brad you are a gem.
Sry devMountain, you'll have to wait. Finishing up on going through the basics of everything needed for this. Now i know what i've been pumping keys for all this time. THIS is my Everest!
Hope there will be this kind of video series with angular too
The best tutorial, congratulations!
This is really well done. Thanks!
Great Content, really well explained!
Title should be "Full Stack React & Django [0] " 😂
I was actually searching for 0th episode :P
wow tnx Brad
I'm not leaving home until summer 😊👌❤👏👏👏
Thank You, thats so good and nice timing for me
Thanks @Traversy Media for yet another great set of tutorial! I would love to know how to send mail in React using Django as a backend. Thanks yet again
Awesome stuff, thanks for sharing this series. I am coding along with you.
Hi Brad, I absolutely love the content that you produce, I actually drew inspiration to self teach myself on web programming after I stumbled onto one of your videos on youtube where u gave us your backstory, how u became a self-taught developer. Can u start a series on GREENSOCK ? There is almost no or complete video of greensock js library which is I think the best js library for creating epic animation on web.
What a timing i was searching for this today ♥ God Bless You Brad :)
Thanks Sir.
Did resolve my problem !!
The djangorestframework got updated and we are required to fix this:
class LeadViewSet(viewsets.ModelViewSet):
queryset = Lead.objects.all()
serializer_class = LeadSerializers #this is required for the updated version
permission_classes = [
permissions.AllowAny
]
serializer_class might be different but that shows as an error if not mentioned.
my exact code still shows error
Class 'Lead' has no 'objects' member
@@UncleNabs Did you perform migrations, if yes then its a vscode error thing, Put objects = models.Manager() in the class. It might work
@@kamranmoazzamansari7289 It's still saying the same thing. I tried to migrate before and it worked but that was before we created the api.py file. Now when I tried to migrate again it threw an error from .api import path, include
ImportError: cannot import name 'path' from 'leads.api'
@@UncleNabs ummm, from .api import LeadViewSet I think u made this from .api import path,include , which should have been, from django.urls import path, include I hope that works.
check yours serializers.py file it should be fields = "__all__" not field = "__all__"
This video is really really helpful. Thank you😍
Mind Blown!
Thank you so much. Cheers
{ "detail": "Authentication credentials were not provided." }
i get this error when using get/post request on postman
any help??
thank you so much sir for this video tutorials..🙏🙏
Great tutorial, thanks a lot!
I was looking for a tutorial on this topic thanks. :)
Oh my God!!! Thank you!!!!! I was struggling with this
I'm on windows 10. To get the setup working I had to do 'py -m ensurepip' because there was no pip file in my Python Scripts folder, and instead of 'pip install pipenv' I had to use 'py -m pip install pipenv'. Whenever he uses 'python' in the command prompt I instead use 'py' because 'python' doesnt work.
The Incredible Brad
For the people who wanto to use the PUT method is the same url but with the id at the end and a slash "localhost:8000/api/leads/{id_toUpdate}/" and in the body as raw send a new object like the POST method seems like you have to send complete objet not only the field to change
Awesome series.
Wow! Thanks Brad, this is the best combination im my opnion! Maybe with graphql in the next?
Thanks Brad!
3:19 for windows users its actually: py --version
Right when I am about to dig a bit about Python!
Thanks Mr. Brad...
Hope you get back to PHP tips soon ..
Django rest + Vue please
15:25 initializing it like that at runtime looks so awkward to me... isn't there a way to build the queryset through a method with arguments just like a regular constructor?
Thank you ♥️
What are the advantages of having react and django in one project folder? besides the obvious reason.
from leads.models import Leads
unresolved import 'leads.models' where i made mistake, how to fix it?
I'm having the same issue, I'm not sure where it's coming from either...
I figured it out. Change it to 'from .models import Leads'
@@machollister2949 Thanks
@@machollister2949 Thank you!
@@machollister2949 Thanks
I've only done spa independent react apps as well, I'm interested in making server side rendering with react and Django would this be related to that?
full-stack machine learning coders are getting hard on's
Thank you 👨
Hey Brad, can you also do a series on React & Symfony Rest API. Thanks for your awesome videos.
Thank You very much!!!