Real-Time Search Result With Django and Ajax

What is Ajax?

AJAX stands for Asynchronous JavaScript And XML, which allows web pages to update asynchronously by exchanging data to and from the server. This means you can update parts of a web page without reloading the complete web page.

It involves a combination of a browser built-in XMLHttpRequest object, JavaScript, and HTML DOM.

Working of Ajax.

  1. An event occurs on a web page, such as an initial page load, form submission, link or button click, etc.
  2. An XMLHttpRequest the object is created and sends the request to the server.
  3. The server responds to the request.
  4. The response is captured and then the server responds back with response data.

Django With Ajax

What we are going to do?

In this tutorial, we will create a Django model for storing a list of famous web series(name, poster). We will have a form on a webpage and when users start searching for the web series the server will show the results based on users queries, and this all will happen in real-time, something like google does with a google search.

Writing whole code in a medium blog is obviously not an option and definitely not a good idea. So I have created a youtube tutorial for the same, do check that, and by doing so you are also supporting me.

Django with Ajax

Thank.

Cheers!!!

Happy Coding.

Leave a Reply