After Reading Documentation. I was confused. you did it very well. thanks from India...
@professionalfacepuncher83614 жыл бұрын
at last !! someone did an example video, I've been waiting so long for this (I've read the docs, but i wanted to know if i am doing things wrong, always better to watch an expert do things to get a perspective than just wing it) thanks alot man , subbed and liked.
@Pyplane4 жыл бұрын
Thank you :) however if you want to see a real Django expert in action - check out Daniel Feldroy’s channel. I’m not an expert just a practicioner :)
@aashayamballi4 жыл бұрын
True! Luke is ahead of everybody😀
@professionalfacepuncher83614 жыл бұрын
@@Pyplane thanks for your humble recommendation will check it out
@professionalfacepuncher83614 жыл бұрын
DEP009 is some exciting stuff, async enabled querysets will be coming soon i'm just wondering what this will mean for the rest framework.
@aashayamballi4 жыл бұрын
Just had a question, can't we use async views in Django rest framework? Because serialization and other things happen there right?
@milonmahato194 жыл бұрын
Finally, I found it. 😍😍. Please keep going. Take love.
@Pyplane4 жыл бұрын
Hi Milon. Happy you're still here and very glad you liked the video. Cheers! :)
@sansinghsanjay2 жыл бұрын
Very nice, well-organized, and informative video. I got huge help by watching your other videos on Django. Thanks a lot for this wonderful work and please keep it up!
@MrValVet2 жыл бұрын
Your tutorials are so good, I'm going to go through all of them :)
@rramos5502 жыл бұрын
Great explanation. Just add the "total" to the httpresponse instead of counting the seconds or searching the log. thumbs Up!
@jameskulu4 жыл бұрын
Was waiting for this. Great one
@Pyplane4 жыл бұрын
Hi James. Thanks. Happy you liked it :)
@paborlouise3194 жыл бұрын
Finally async views. Great one 🔥
@Pyplane4 жыл бұрын
Thank you Pabor! :)
@aashayamballi4 жыл бұрын
Hey Luke! This channel really deserve more and my suggestion would be give a tutorial on Brad Traversy's channel. People will definitely follow you here. Django 3.1 async views I was waiting for this tutorial and here we go... You never disappoint us. Keep up the good work Luke an never stop producing such a good tutorials. Many many thank you 🙏😊
@Pyplane4 жыл бұрын
Thank you Aashay. Regarding the views on my channel - I know they aren’t spectacular, but I’m very happy :) I honestly didn’t believe I’ll get 1000 subscribers. As it is for Brad Travesy channel I have to first improve my english :) thanks a milion times for the support!
@aashayamballi4 жыл бұрын
@@Pyplane you're awesome!
@Shaunmcdonogh-shaunsurfing4 жыл бұрын
Great tutorial and thank you
@nareshkumar-mm3hq4 жыл бұрын
Many thanks Luke for @nother great video
@Pyplane4 жыл бұрын
Thanks for watching Naresh! :)
4 жыл бұрын
You should use `ab` to confirm that the async view would enable more requests to be handled as a effect of not blocking requests to execute while they wait for the io.
@MartinoxxHD2 жыл бұрын
what does ab mean?
@gregcompton9631 Жыл бұрын
For Django 4.x - You need to change @sync_to_async to @sync_to_async(thread_sensitive=False) before get_stories_async() and get_movies_async() functions. Huge thanks to @ssadxuyui5060 who first commented the solution over a year ago in a reply.
@BadCountryRanch Жыл бұрын
that was it! thank u!
@ukaszkozicki7721 Жыл бұрын
Thanks a lot man, I was really beginning to think I'm on the wrong side of a bad dream :)
@NotBeHaris4 жыл бұрын
another great tutorial Respect.
@Pyplane4 жыл бұрын
Thank you Muhammad :)
@bentwite30934 жыл бұрын
This is a most watch :)
@rangabharath42534 жыл бұрын
awesome as always. tq so much :-)
@Pyplane4 жыл бұрын
thanks for watching :)
@zorojuro51064 жыл бұрын
thanks a lot mate keep the good work :)
@Pyplane4 жыл бұрын
Thanks for watching :) cheers!
@vaibhavgupta44134 жыл бұрын
@Pyplane awesome 😈😈😈😈😈
@rajughorai39094 жыл бұрын
Thanks for this video.
@Pyplane4 жыл бұрын
Thanks for watching :)
@JustPython Жыл бұрын
Nice job
@seandenny64304 жыл бұрын
Amazing!!!
@Pyplane4 жыл бұрын
Thank you! 🙂
@yukselbastan46874 жыл бұрын
great video thank you Lukas.
@Pyplane4 жыл бұрын
Hi Yuksel :) glad you liked it :))
@yukselbastan46874 жыл бұрын
@@Pyplane improvements are always good, thank you. And by the way i made it trough by atthost, finally it worked .
@Pyplane4 жыл бұрын
@@yukselbastan4687 Wowowow...congrats. That's a huge thing - make it work without knowing the Polish language. Congrats 100x !
@yukselbastan46874 жыл бұрын
@@Pyplane thank you very much, you as our teacher you should become the thanks ;), just one question please, can i work years with atthost without any problems i mean should i make a 5 year payment ?
@Pyplane4 жыл бұрын
@@yukselbastan4687 I don't know that :/ I pay annually each time
@AbhishekBharadwaj-s1i Жыл бұрын
When I define the post function in view as "async" like the async def main_view_async(), I keep getting this error: AssertionError: Expected a `Response`, `HttpResponse` or `HttpStreamingResponse` to be returned from the view, but received a `` What's the way around this?
@siya.abc1234 жыл бұрын
Dope video!
@Pyplane4 жыл бұрын
Thank you!:)
@Isaacv-mk3mi4 жыл бұрын
can we use this with django rest projects?
@DimitrisKougioumtzis2 жыл бұрын
very good tutorial , can i use async with class based views ? does django supports it ?
@stevemapes96722 жыл бұрын
In as of Django 3.1 - docs.djangoproject.com/en/4.1/topics/async/#async-views
@pinchasnachmani14183 жыл бұрын
Thank you, What if i did not use with the await command, is it impossible (line 56)?
@АнатолийБугаков-е9г3 жыл бұрын
Isn't Movie.objects.all() a sync function and hence blocks the requests?
@djangodeveloper073 жыл бұрын
hi great tutorial as usual. i was finding something else and found you again. for example if we have 1000 requests data to show in template. can we show data of each request whenever request data returns like request 1: loading request 2: success here is your data value request 3: success here is your data value request4: loading request5: fail etc and each request is on different api . feel like real app data. need it very badly any guide or help ?
@jayachandraB3 жыл бұрын
how to capture the return values from async get movie and async get stories in main view async
@amanguptadev4 жыл бұрын
Bro i am uploading images on GCP and then create entry in database but when i run it. It is only create entry not upload image
@danielaceros57234 жыл бұрын
Thanks Luke!
@Pyplane4 жыл бұрын
Hi Daniel! Nice to hear from you again :) happy you liked the video :) Cheers!
@danielaceros57234 жыл бұрын
@@Pyplane ohh my friend. That's great you remember me! I've learnt a lot from you. Keep going!. Dziękuję Ci!
@Pyplane4 жыл бұрын
@@danielaceros5723 Of course I do. My memory isn't perfect but I'll always remember the people who motivated me to carry on :) I am very happy and proud that you learned something from me :) Have a great day :) btw. nice Polish :))
@yukselbastan46874 жыл бұрын
1.77K Subscribers nice :D
@dgiri2333 Жыл бұрын
How to get async function orm result send back to temple
@NotBeHaris4 жыл бұрын
I have a question that how we get data from database without refreshing page. Else ajax because i read in one video comment that it is not good way.
@Pyplane4 жыл бұрын
I personaly don't work with ajax - the reason is that the code can get messy when building more advanced applications. For me a much better and easier way to do this is using django rest framework and react on the frontend. A tutorial on this will appear on the channel pretty soon. Cheers
@NotBeHaris4 жыл бұрын
@@Pyplane i am waiting for this and django channel
@NotBeHaris4 жыл бұрын
how much i wait for this..?
@Pyplane4 жыл бұрын
@@NotBeHaris the seconda part of the crypto app will be released at the beginning of September :)
@stevemapes96722 жыл бұрын
AJAX or Websockets are the most common approach. The latter will be faster due to less network overhead
@ckom93 жыл бұрын
Thanks!
@wilmerferneycubidesporras77743 жыл бұрын
how to apply this concept to a real world example?
@dexterslab77504 жыл бұрын
I just ran your code and I am seeing same result.. am i missing something..
@ИльяЯгупов-н4я3 жыл бұрын
For me also the sync and async requests have the same execution time. I used the code from git.
@rodolfo4880-e4j3 жыл бұрын
me too, what's going on?
@rodolfo4880-e4j3 жыл бұрын
It works in django 3.1 but not django 3.2
@MrNiceseb3 жыл бұрын
Also the same 7 secs regardless in Django 3.2
@DeepakKumar-uz4xy3 жыл бұрын
@@rodolfo4880-e4j i am also using 3.1.2 verison but result is same.
@deepanshuaggarwal70424 жыл бұрын
Hi, I like this method. But, i have 1 doubt. It it necessary to wait for task to complete as my task will take around 30 minutes to complete.
@Pyplane4 жыл бұрын
Hi. I don’t know the details of your task but maybe consider running it in the background? Cheers
@ravikumarighare52974 жыл бұрын
@@Pyplane hi, i want hep regarding this. my view takes more than 6 seconds but timeout happens in 5 secinds. how do i send http response first and then do processing. in this example it waits in both cases. i dont want to wait. return response first and then do things. it is possible using async
@coolrezaul3 жыл бұрын
@@ravikumarighare5297 use threading
@ravikumarighare52973 жыл бұрын
@@coolrezaul thanks. threading worked
@DeepakKumar-uz4xy3 жыл бұрын
i tried this but this is not working. sync to async function also running synchronously
@berkayertem59383 жыл бұрын
Try Django version 3.1
@amaangigani93722 жыл бұрын
Not working. Please update or remove this video
@Pterry23real3 жыл бұрын
Not really a good video. You doesn't explain very much, your toy example is too trivial to show something and also it just doesn't work as aspected. And yeah I saw the edited note about asyncio.sleep but if you can edit this you should have rather re-record this video. Cool that you make videos to show off new stuff but please more effort the net is full of broken toy examples like this. Personally I don't want that python becomes the next js in this regard.