Django AJAX Tutorial: Basic AJAX in Django app with Fetch API | Django casts

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ต.ค. 2024

ความคิดเห็น • 73

  • @RedEyedCoderClub
    @RedEyedCoderClub  2 ปีที่แล้ว

    What video should I make next? Any suggestions?
    Follow me @:
    Telegram: t.me/red_eyed_coder_club
    Twitter: twitter.com/CoderEyed
    Facebook: fb.me/redeyedcoderclub
    Timecodes:
    00:00 - Beginning. Demo of the project.
    00:44 - Description of the starting Django project.
    01:50 - Adding a JavaScript file
    02:14 - Simple example of JavaScript onclick event handler
    04:00 - Sending an AJAX GET request to Django with Fetch API
    09:21 - Sending AJAX POST request to Django with Fetch API
    12:58 - Getting CSRF token for an AJAX POST request
    16:35 - Handling an AJAX POST request on the Django side.

    • @codedjango
      @codedjango 2 ปีที่แล้ว

      Same project with Django + Vue3? I want to see how advantageous it would be to use a frontend framework over ajax? OR is ajax the best approach? Not sure

    • @RedEyedCoderClub
      @RedEyedCoderClub  2 ปีที่แล้ว

      @@codedjango Thanks for comment and for suggestion.
      Using of native JS or a framework like Vue depends on your project. How complex should it be. Frameworks like Vue allows to manipulate DOM easily.
      For example, you got a list of objects from Django, a list of comments for example.
      How can you render them with pure JavaScript?
      With Vue.js you can use something like
      ...
      And you'll get the same markup for each comment easily.
      I think the advantages of using Vue.js on example of this project won't be obvious. The example is just too simple, too primitive.

    • @codedjango
      @codedjango 2 ปีที่แล้ว

      @@RedEyedCoderClub Ok

    • @archibaldivanovich4103
      @archibaldivanovich4103 2 ปีที่แล้ว

      Try Htmx , it seems really easy to use it ,instead writing on JavaScript !

    • @RedEyedCoderClub
      @RedEyedCoderClub  2 ปีที่แล้ว

      @@archibaldivanovich4103 Thanks for comment. I already tried it.

  • @theanonymous92
    @theanonymous92 2 หลายเดือนก่อน

    Thank you so much explaining in such a simple manner I couldn't find any simple explanation since yesterday you made it so easy❤❤❤

  • @armii666
    @armii666 ปีที่แล้ว

    Олег, спасибо вам за этот маленький гайд!

  • @lisw22
    @lisw22 2 ปีที่แล้ว +1

    Great video, useful information. Thank you.

  • @AnnaNEast
    @AnnaNEast 2 ปีที่แล้ว

    Thank you for the wonderful Django AJAX guide.

  • @TP-rs2un
    @TP-rs2un 2 ปีที่แล้ว

    Very clear and detailed coverage on this topic. Thank you for this video.

  • @МаринаПеткова-у9м
    @МаринаПеткова-у9м 2 ปีที่แล้ว

    Excellent and accessible explanation from the author. Thank you for such simple and clear lessons.

  • @agatagate2842
    @agatagate2842 2 ปีที่แล้ว

    A good analysis of the basic Django tools. Video tutorials help to better understand the methodology of building queries. Understanding the theory turns out faster when the material is presented in such detail.

  • @kostya9169
    @kostya9169 2 ปีที่แล้ว

    Thank you very much for an interesting and useful video. Now even an inexperienced user can understand Django AJAX .

  • @ЛилияАнпилогова-к8ж
    @ЛилияАнпилогова-к8ж 2 ปีที่แล้ว

    Thanks for information, it was helpful and easy to understand!

  • @oliveratkinson913
    @oliveratkinson913 2 ปีที่แล้ว

    With your help , I learned the capabilities of the Django AJAX language . I like an editor with color-coded commands and set comments in the text. This visualization helps in the work

  • @ЗаработайБезРаботы
    @ЗаработайБезРаботы 2 ปีที่แล้ว

    Great. thanks for the analysis

  • @serg_D
    @serg_D 2 ปีที่แล้ว

    Very insightful and informative video. The author to keep the brand is also high!

  • @kostya9169
    @kostya9169 2 ปีที่แล้ว

    Great video tutorial and very informative. Thank you very much it helped me..

  • @СергейАлександрович-п6я7т
    @СергейАлександрович-п6я7т 2 ปีที่แล้ว

    Thank you so much for the training work you have done, you have helped a lot!

  • @ФедяИванов-о2ш
    @ФедяИванов-о2ш 2 ปีที่แล้ว

    great video --- thanks

    • @RedEyedCoderClub
      @RedEyedCoderClub  2 ปีที่แล้ว

      Thanks for watching, and for the comment!

  • @farzadmf
    @farzadmf 2 ปีที่แล้ว +2

    Isn't `data` already `await`ed by doing `await res.json()`? I don't think we need to `await` it again, do we?

    • @RedEyedCoderClub
      @RedEyedCoderClub  2 ปีที่แล้ว +2

      You are right! No need to do it. Thanks for your comment!

  • @daniellewis6117
    @daniellewis6117 2 ปีที่แล้ว

    Learning Django AJAX diango should start with basic queries, understand the methodology of their construction, and then expand your knowledge. A very convenient editor, color highlighting, levels visually facilitates the understanding of the program

  • @mcaq1
    @mcaq1 2 ปีที่แล้ว +1

    Hi, nice video. Can you make another one how make both like and dislike buttons using Ajax and Django?
    Found little information about it

    • @RedEyedCoderClub
      @RedEyedCoderClub  2 ปีที่แล้ว +1

      Ok, thanks for your suggestion!

    • @mcaq1
      @mcaq1 2 ปีที่แล้ว

      @@RedEyedCoderClub I look forward to it

  • @TheApgreyd
    @TheApgreyd 2 ปีที่แล้ว

    Will there be more videos on "Олег Молчанов"?

  • @lizardsquad6875
    @lizardsquad6875 2 ปีที่แล้ว

    Олег, это же вы?))

  • @OlegBosi
    @OlegBosi 2 ปีที่แล้ว

    Super

  • @captainfracassful
    @captainfracassful 2 ปีที่แล้ว

    I begin to understand how it works if I resume it is possible to do the same operation with pyscrip if we create an asynchronus method beforehand, then you use the browser api to fetch you AJAX post (?) anyway Thank's for the trouble as usual great video !

    • @RedEyedCoderClub
      @RedEyedCoderClub  2 ปีที่แล้ว

      Thank you!
      I have videos about using PyScript, and the idea is the same.

  • @ameyapotdar461
    @ameyapotdar461 2 ปีที่แล้ว

    can you make a video of filtering items by color using django and ajax?great video!

  • @lukasgv92
    @lukasgv92 ปีที่แล้ว

    Unfortunately, I am getting an error when trying to fetch the random numbers at the front-end by clicking the "go" button (08:08). My broswer sends the error message :"r: Unexpected token '

    • @lukasgv92
      @lukasgv92 ปีที่แล้ว

      Just solved it myself - in the javascript file I wrote "header" instead of "headers". Sorry for the confusion and thank you for the amazing tutorial!

  • @andreylagno2372
    @andreylagno2372 2 ปีที่แล้ว

    nice video

  • @andreylagno2372
    @andreylagno2372 2 ปีที่แล้ว

    good video

  • @nadijalesina6864
    @nadijalesina6864 2 ปีที่แล้ว

    A tutorial on Django AJAX without practical tasks will not do much good. Therefore, such video analysis of the properties and methods of the language helps a lot in the application and use of this mechanism.

  • @sashapomin
    @sashapomin 2 ปีที่แล้ว

    How many is it needed studies time, what such to do?

  • @lich_liars6735
    @lich_liars6735 ปีที่แล้ว

    My code just doesnt seem to fetch the data at 6:02 doesnt work with the line await fetch()

    • @RedEyedCoderClub
      @RedEyedCoderClub  ปีที่แล้ว +1

      Did you check your code twice? Focus on your understanding of what you are doing - it's the key.

    • @lich_liars6735
      @lich_liars6735 ปีที่แล้ว

      @@RedEyedCoderClub Yeah, i forgot to check the async function. Getting js function to work on django is really toughest part for me somehow.

  • @ajoyjohn1487
    @ajoyjohn1487 2 ปีที่แล้ว

    can you send the link to the code

  • @sashapomin
    @sashapomin 2 ปีที่แล้ว

    power play