Python is regarded as an excellent introductory language for programmers who have never attempted programming. Django, on the other hand, is a high-level web framework based on Python that enables the development of Web applications with a little number of lines of code.
As with any large software project, Django contains a wide number of concepts, features, and tools, and the scope of the problems it was created to answer, especially Web development. To begin understanding the specific use of Django, you must first comprehend these issues, and Django framework is here to tackle them.
HTTP (HyperText Transfer Protocol) encapsulates the complete procedure for serving Web pages and serves as the Web's foundation. As a client-server communication protocol, HTTP consists primarily of requests (from client to server) and answers (server to client)
What occurs on the server between them is not governed by HTTP and is the responsibility of the server software.
The request idea encompasses the initial phase of the process, which consists of the client requesting a certain document from the server. The URL—the "path" to the requested document—is the core of a request, but it can be further customized using a variety of methods, allowing a single location or URL to display numerous behaviors.
A response consists mostly of a body - often the text of a Web page - and associated headers that provide additional information about the data, such as when it was last updated, how long it should be cached locally, its content type, etc. Other non-HTML content that may be provided in response includes plain text, photos, documents (PD Word, Excel, etc.), audio clips, etc.
Both requests and answers are represented by Django as relatively simple Python objects with attributes for the various types of data and methods for more advanced operations.
Simply put, the Web is about data transfer or the sharing of content (meaning absolutely anything, including blog posts, financial data, and ebooks). In the early days of the Web, content consisted of manually-written HTML text files kept on the server's disk. This is referred to as static since requests to the same URL always return the same data. The "path" stated previously was more basic; there were no parameters, as it was simply the path on the server's file system where the static content resided. Presently, the majority of the material is considered dynamic because the data delivered by a given URL might fluctuate substantially based on a variety of variables.
A significant portion of this dynamic nature is made possible by storing data in a database, where, instead of a single string of text, one may generate multipart data pieces and link them together to show relationships. SQL (Structured Query Language) is used to define and query the database and is frequently abstracted further by an ORM (Object-Relational Mapper), which enables object-oriented programming languages to represent the database as code objects.
SQL databases are organized into tables, with each table containing rows (such as entries, items, and objects) and columns (such as attributes and fields), similar to a spreadsheet. Django provides a robust ORM in which Python classes represent tables, objects represent specific rows within those tables, and the columns of the table are attributes of the objects.
How to show or format the information requested and/or returned over HTTP and queried from the SQL database is the final piece of the Web development puzzle. This is typically done in HTML (HyperText Markup Language) or its more recent, XML-like cousin XHTML, as well as the languages of JavaScript for dynamic browser-side functionality and CSS (Cascading Style Sheets) for visual style. Enabling dynamic content in modern applications are JSON (a "light" data format) and XML.