In this tutorial, we are going to learn how to use AJAX with Django to make web applications more fast and dynamic. We will send AJAX request and using Django AJAX Response we will update the web page. For this tutorial, I am using JQuery. You can also handle AJAX with Django libraries like django-dajax or Javascript. But the concept of working with AJAX request with Django will be the same.
- Create a folder and put all the files inside it.
- Create a virtual environtment -
virtualenv env
- Activate VirtualENV -
. env/bin/activate
- Run Requirements.txt -
pip3 install -r requirements.txt
- Run the Application -
python3 manage.py runserver
- Go to - http://localhost:8000/simpleajax/
We already have data in database SQLite. If you put huzaif
in username field it will give message 'User name Already Exists'