How To Debug a Django Application in VS CODE (Visual Studio Code)

Поделиться
HTML-код
  • Опубликовано: 2 ноя 2024

Комментарии • 21

  • @YevGuyduy
    @YevGuyduy Год назад +3

    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!

  • @qtech6672
    @qtech6672 Год назад

    Spend several hours investigating around. Finally found out that your solution works!!!

  • @xorengames
    @xorengames 10 месяцев назад

    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!

  • @MrValVet
    @MrValVet 6 месяцев назад +1

    Thanks, exactly what I was looking for.

  • @lionelmuskwe
    @lionelmuskwe 2 года назад +1

    I instantally subscribed. Bro Keep posting. I got you !!!

  • @NafisaUmarHajjatee
    @NafisaUmarHajjatee Год назад

    Trying to figure this out took me hours! Thank you!

  • @marceherrera3789
    @marceherrera3789 Год назад

    Than you. It's exactly what I was looking for.

  • @electroe2143
    @electroe2143 2 года назад +1

    Great Content ! I have a question , How to debug Django inside docker ? I use nginx as web server.

  • @turbotyoma
    @turbotyoma 2 года назад

    You're the best!Thank you!

  • @SanteeRocks
    @SanteeRocks Год назад +1

    How to do if Django is running in a docker ?

  • @basil2265
    @basil2265 Год назад

    Man you are hero
    thank you very much

  • @PaulaAmstutz
    @PaulaAmstutz Год назад

    Great video, short and works perfectly

  • @kritzelnben6708
    @kritzelnben6708 2 года назад

    Short and concise, very good

  • @rickiodious
    @rickiodious 4 месяца назад +3

    Actual debugging starts @ 4:55

  • @johnsolly
    @johnsolly  2 года назад +5

    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.

  • @akchavshakya4969
    @akchavshakya4969 8 месяцев назад

    its not working sir i placed the breakpoint and through the debug console gave the link but doesnt it the breakpoint. why?

  • @LinhNguyễnVăn-j2i
    @LinhNguyễnVăn-j2i Год назад

    How can I debug it on WSL

  • @nevilpanchal
    @nevilpanchal 2 года назад

    great video but not working in window based visual studio django ...i dont know why

  • @olivierdeplanques708
    @olivierdeplanques708 2 года назад

    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.

    • @johnsolly
      @johnsolly  2 года назад

      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!