Thanks for this, very helpful now that I'm back into developing on my Wagtail CMS, which is Django based. This worked perfectly and will greatly increase my productivity. Cheers!
Just learned if you add "django": true to your config, you can debug the django HTML templates! See -> code.visualstudio.com/docs/python/debugging under 'Specific app types" You might also want to add these two lines of code to the end of your test file so you can re-run the test after hitting a breakpoint.
Great video very clear thanks. I didn't know the corey's tutorial (thanks for the link). i just don't understand how to debug generic views, because in views.py instead of return render (....) you have just a class declaration. A good example is in the tutorial of thenewboston chap 29 on youtube (best tutorial serie i've seen) : ruclips.net/video/c3yB0_4Yd48/видео.html&ab_channel=thenewboston At 2:20 he changes views for generic views but i haven't found how to debug that.
Thanks for the comment Oliver! I haven't actually used generic views before, but my SearchView is using that return render (....) way of doing things instead of using a class. def SearchView(request): cat_list = Category.objects.all() if request.method == 'POST': searched = request.POST['searched'] filtered_posts = Post.objects.filter(Q(content__icontains=searched) | Q(title__icontains=searched)) return render( request, "blog/search_posts.html", {"cat_list": cat_list, "searched": searched, "filtered_posts": filtered_posts}, ) else: return render( request, "blog/search_posts.html", {"cat_list": cat_list}, ) When you say, 'I don't understand how to debug generic views' what part are you trying to get at that you can't catch with a breakpoint? I will admit sometimes it feels like I can't debug what is going into the Jinja template. Also, I love @thenewboston and I've seen a bunch of his generic Python videos. I'll need to look into his Django stuff too!
wow !!!! right to the point and straight forward. saved me probably like 5 hours of researching and trying to work it out. thank you so much!
Spend several hours investigating around. Finally found out that your solution works!!!
Thanks for this, very helpful now that I'm back into developing on my Wagtail CMS, which is Django based. This worked perfectly and will greatly increase my productivity. Cheers!
Thanks, exactly what I was looking for.
I instantally subscribed. Bro Keep posting. I got you !!!
Trying to figure this out took me hours! Thank you!
Than you. It's exactly what I was looking for.
Great Content ! I have a question , How to debug Django inside docker ? I use nginx as web server.
You're the best!Thank you!
How to do if Django is running in a docker ?
Man you are hero
thank you very much
Great video, short and works perfectly
Short and concise, very good
Actual debugging starts @ 4:55
Just learned if you add "django": true to your config, you can debug the django HTML templates! See -> code.visualstudio.com/docs/python/debugging under 'Specific app types"
You might also want to add these two lines of code to the end of your test file so you can re-run the test after hitting a breakpoint.
its not working sir i placed the breakpoint and through the debug console gave the link but doesnt it the breakpoint. why?
How can I debug it on WSL
great video but not working in window based visual studio django ...i dont know why
I have the same issue
Great video very clear thanks. I didn't know the corey's tutorial (thanks for the link).
i just don't understand how to debug generic views, because in views.py instead of return render (....) you have just a class declaration. A good example is in the tutorial of thenewboston chap 29 on youtube (best tutorial serie i've seen) :
ruclips.net/video/c3yB0_4Yd48/видео.html&ab_channel=thenewboston
At 2:20 he changes views for generic views but i haven't found how to debug that.
Thanks for the comment Oliver! I haven't actually used generic views before, but my SearchView is using that return render (....) way of doing things instead of using a class.
def SearchView(request):
cat_list = Category.objects.all()
if request.method == 'POST':
searched = request.POST['searched']
filtered_posts = Post.objects.filter(Q(content__icontains=searched) | Q(title__icontains=searched))
return render(
request,
"blog/search_posts.html",
{"cat_list": cat_list, "searched": searched, "filtered_posts": filtered_posts},
)
else:
return render(
request,
"blog/search_posts.html",
{"cat_list": cat_list},
)
When you say, 'I don't understand how to debug generic views' what part are you trying to get at that you can't catch with a breakpoint? I will admit sometimes it feels like I can't debug what is going into the Jinja template.
Also, I love @thenewboston and I've seen a bunch of his generic Python videos. I'll need to look into his Django stuff too!