Тёмный

How to diagnose and fix slow queries with Django Debug Toolbar 

Matt Segal
Подписаться 1,4 тыс.
Просмотров 7 тыс.
50% 1

blog post: mattsegal.dev/...
code on github: github.com/Mat...
Your Django views are running slowly and you want to make them faster, but you can't figure out what the issue is just by reading the code. Just as bad is when you're not sure if you're using the Django ORM correctly - how can you know if the code you write will be slow?
This is where a profiling tool comes in handy. Django Debug Toolbar is great for figuring out why your Django views are going slow. This guide will show you how to use DJDT to find and fix slow database queries in your views.
Does you business need to launch a new Django site? I can help: mattsegal.com.au

Опубликовано:

 

14 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 25   
@AlphaWatt
@AlphaWatt 2 года назад
Got me to lol at the “shit ton” of queries. Also, the robe is baller. Seriously though, thanks again for the time on these Matt. Your explanations and the thoroughness of them has helped me grow my confidence by affirming I was on the right track or not with my project. 🙏 sincerely appreciate it
@MrValVet
@MrValVet Год назад
Wow, what an amazing tutorial. Thank you and hopefully we'll see more from you.
@skillgambling
@skillgambling 4 года назад
Hey Matt, nice video and great blog! At 31:40 you're wondering why it's doing the same query twice. It's doing that, because you forgot to comment out the 'slow version' in your view. Cheers!
@Regal975
@Regal975 4 года назад
Nice spot, thanks Thomas!
@Georgeggg82
@Georgeggg82 3 года назад
By far the most well explained django query optimization video I’ve seen on RU-vid. Thanks for this.
@dddsa5951
@dddsa5951 3 года назад
Extra useful! I just got the django debug toolbar and was overwhelmed by the amount of info it shows me, but now it all makes sense. Thank you for the video!
@antoinemercier82
@antoinemercier82 3 года назад
Very clear demonstration of how to use django debug toolbar, thanks!
@michaelarthurholloway9539
@michaelarthurholloway9539 3 года назад
This is an excellent video, and super helpful to me, so thank you! The way you show the SQL printout for each action was super helpful in understanding what, exactly, was going on each time, so great choice there. Cheers!
@jaradc2198
@jaradc2198 Год назад
Him: "It's a shit-ton. 27 queries." Me: Hmm, what's mine? 142. *sigh*
@MohamedAyman-li6rp
@MohamedAyman-li6rp 3 года назад
Thanks for the video, One thing to mention though, there is a problem of a duplicated records within the database and that's will make a larger space. That kind of problem happens because you didn't design the database with normalization in mind, for example, within the Comment Model there are two foreign keys that break the 3NF rule.
@mohcench1903
@mohcench1903 Год назад
Underrated video
@ddhingra1991
@ddhingra1991 4 года назад
Nice detailed video on django debug toolbar. Really helpful!
@chelpav
@chelpav 2 года назад
That was very helpful, thanks a lot!
@ermalgashimramori
@ermalgashimramori 2 года назад
Thank you very much, great value!
@radeshf
@radeshf 3 года назад
that too much good info about djDT that really helped me thank you
@skrushinsky
@skrushinsky 2 года назад
Thank you, Matt! You really saved my day&
@krisdeed
@krisdeed 4 года назад
18:58 Magic Matt transformation :)
@ai.201
@ai.201 2 года назад
This is very good.
@Trijicon2
@Trijicon2 4 года назад
Thank for this video! You explained it very well :)
@zurababduev1809
@zurababduev1809 3 года назад
Thank a lot !!
@LavYash
@LavYash 3 года назад
Hi Matt.. These tips have helped me optimize my queries. Thanks for the video.. However, I'm not able to optimize one scenario.. In the detailed view page, I have also attached comment to each post. This results in fetching of user table every time it needs to find the user of a comment. I tried to override the get_queryset method too but it did not help. It would be amazing if you could give few tips to tackle this.
@gabrielamagallanes5071
@gabrielamagallanes5071 3 года назад
Thank for this video! Does Django Debug Toolbar work with DRF? I am trying without success :(
@ritanjandawn
@ritanjandawn 3 года назад
yes it does, you need to make few additional changes
@gshard14
@gshard14 3 года назад
Thanks.
@inganzamarumpu
@inganzamarumpu 4 года назад
Ça c'est de l'Or
Далее
Integrating Silk to inspect your Django applications
11:53
Dynamic list views with Django and htmx
34:09
Просмотров 14 тыс.
Solving one of PostgreSQL's biggest weaknesses.
17:12
Просмотров 201 тыс.
Data Performance Tips with Django
59:50
Просмотров 9 тыс.