
Quick Contact
Python Tutorial
- What is Python?
- How to Install Python?
- Python Variables and Operators
- Python Loops
- Python Functions
- Python Files
- Python Errors and Exceptions
- Python Packages
- Python Classes and Objects
- Python Strings
- PostgreSQL Data Types
- Python Generators and Decorators
- Python Dictionary
- Python Date and Time
- Python List and Tuples
- Python Multithreading and Synchronization
- Python Modules
- What is Python bytecode?
- Python Regular Expressions
Python Panda Tutorial
- Python Pandas Tutorial
- Python Pandas Features
- Advantages and Disadvantages of Python Pandas
- Pandas Library In Python
- Pandas Series To Frame
- Python Dataframeaggregate and Assign
- Pandas Dataframe Describe
- Pandas Dataframe Mean
- Pandas Hist
- Pandas Dataframe Sum
- How to convert Pandas DataFrame to Numpy array
Python Selenium
- Selenium Basics
- Selenium with Python Introduction and Installation
- Navigating links using get method Selenium Python
- Locating Single Elements in Selenium Python
- Locating Multiple elements in Selenium Python
Python Flask Tutorial
Python Django
- How to Install Django and Set Up a Virtual Environment in 6 Steps
- Django MTV Architecture
- Django Models
- Django Views
- Django Templates
- Django Template Language
- Django Project Layout
- Django Admin Interface
- Django Database
- Django URLs and URLConf
- Django Redirects
- Django Cookies and Cookies Handling
- Django Caching
- Types of Caching in Django
- Django Sessions
- Django Forms Handling & Validation
- Django Exceptions & Error-handling
- Django Forms Validation
- Django Redirects
- Django Admin Interface
- Django Bootstrap
- Ajax in Django
- Django Migrations and Database Connectivity
- Django Web Hosting and IDE
- Django Admin Customization
- What is CRUD?
- Django ORM
- Django Request-Response Cycle
- Django ORM
- Making a basic_api with DRF
- Django Logging
- Django Applications
- Difference between Flask vs Django
- Difference between Django vs PHP
Numpy
- Numpy Introduction
- NumPy– Environment Setup
- NumPy - Data Types
- NumPy–Functions
- NumPy Histogram
- numPy.where
- numpy.sort
- NumPyfloor
- Matrix in NumPy
- NumPy Arrays
- NumPy Array Functions
- Matrix Multiplication in NumPy
- NumPy Matrix Transpose
- NumPy Array Append
- NumPy empty array
- NumPy Linear Algebra
- numpy.diff()
- numpy.unique()
- numpy.dot()
- numpy.mean()
- Numpy.argsort()
- numpy.pad()
- NumPyvstack
- NumPy sum
- NumPy Normal Distribution
- NumPylogspace()
- NumPy correlation
- Why we learn and use Numpy?
Tensorflow
- Introduction To Tensorflow
- INTRODUCTION TO DEEP LEARNING
- EXPLAIN NEURAL NETWORK?
- CONVOLUTIONAL AND RECURRENT NEURAL NETWORK
- INTRODUCTION TO TENSORFLOW
- INSTALLATION OF TENSORFLOW
- TENSORBOARD VISUALIZATION
- Linear regression in tensorflow
- Word Embedding
- Difference between CNN And RNN
- Explain Keras
- Program elements in tensorflow
- Recurrent Neural Network
- Tensorflow Object Detection
- EXPLAIN MULTILAYER PERCEPTRON
- GRADIENT DESCENT OPTIMIZATION
Interview Questions & Answers
AJAX in Django
AJAX has now become an important part of web applications. AJAX also helped Django a lot to increase efficiency and save the time of users. All the popular services out there use it in some way or the other.
Applications like Facebook, Twitter, Instagram, Gmail, Google Maps, Spotify, etc cannot function without AJAX.
You will have to deal with AJAX code at some point. Even Google search uses AJAX. You must have seen those predictions down the search bar while typing, those are AJAX generated results.
AJAX in Django
We talked about AJAX and how it is present in our web pages. Now, let’s learn why we need AJAX in Django. AJAX is an acronym of Asynchronous JavaScript and XML.
It is a mixture of technologies implemented to solve a very serious problem. It utilizes XMLHttpRequest objects to transmit and receive data.
How AJAX works in Django
AJAX is nothing but a combination of JavaScript and XHR object. The concept is simple:
-
JavaScript Code on the client –
Side/ browser makes a request when an event occurs on the web page. The JavaScript code will generate an XHR object and is sent as a request object to the server. The XHR object contains some JavaScript data/ object.
- The XHR object also contains the URL or name of the call-back function on server.
-
The request is handled by the server with a callback function –
The appropriate view function or callback function handles the request. It will send a success or failure response. Since the request is asynchronous, the rest of the code executes without interruptions.
- At that time, the server processes the request.
-
The response is received as success and failure –
The success response can contain some server data in multiple formats like:
-
Text Format
Html Format (This contains HTML elements).
-
JSON Format
JSONP Format (It is JSON but only when the response comes from a different domain).
Script (This contains some JavaScript to be changed in page).
-
XML Format
Similarly, a failure response can be formatted.
The JavaScript will execute according to the response received –
The AJAX routine will now execute according to data from the server. We can change the HTML elements or run some JavaScript. Many things are possible using it. The best example is Facebook’s like button.
AJAX has multiple implementations but this is the common flow.
Example of AJAX in Real World
AJAX is very common in web applications. For example – when you like a post on LinkedIn, there are certain actions performed at the back-end but at the front-end, the color of Like button changes.
When you clicked that button, an XHR object was sent to the server. The server receives the request and registers a like for that post. Then, the server sends a success response and the Like button turns to Blue
Using jQuery for AJAX in Django
jQuery is one of the most popular libraries of JavaScript. Many advanced frameworks like Angular JS, React, etc are based on jQuery. It is a very useful library providing functions with DOM of web pages. To use bootstrap’s JavaScript part, jQuery is essential.
We are using jQuery for the following reasons:
-
AJAX implementation is different on multiple browsers
There are many browsers which use different XHR APIs. These APIs parse request and response in a slightly different manner. Keeping your code up-to-date while also making it platform independent can be difficult. jQuery provides you with a built-in solution and takes care of all these things for you.
Since jQuery is actively developed thus, the code is kept updated frequently.
-
jQuery provides a vast range of methods using DOM
jQuery contains many DOM objects and related methods. These objects can be used as per your need and jQuery makes it more convenient to use.
-
jQuery is very popular
jQuery is heavily used in the IT industry. For any web developer, they will deal with jQuery at some point. jQuery has many features and it will be an important skill for you in the long run.
-
jQuery is basic for many popular frameworks
There are many popular frameworks like Angular Js, react js based on jQuery. Bootstrap JavaScript is also based on jQuery. jQuery is basically everywhere on JavaScript frameworks.
These reasons are good enough for anyone to learn and use jQuery. There are more ways by which we can use AJAX in Django like, dajax, dajaxice, etc. These applications are made such that there is minimal JavaScript for AJAX.
Apply now for Advanced Python Training Course