

{"id":72247,"date":"2019-11-07T11:38:49","date_gmt":"2019-11-07T06:08:49","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=72247"},"modified":"2021-06-21T12:19:15","modified_gmt":"2021-06-21T06:49:15","slug":"django-request-response-cycle","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/django-request-response-cycle\/","title":{"rendered":"Django Request-Response Cycle &#8211; An easy to follow guide"},"content":{"rendered":"<p>All backend technologies and web APIs are based on one system that is The Request-Response Cycle. The system is responsible for data interchange between client and servers. Even the new technologies based on micro-services use the Request\/Response cycle.<\/p>\n<p>Request\/Response objects are transmitted over the web. Content like images, HTML, CSS, JavaScript is all Response Objects. In this article, we will learn about these objects.<\/p>\n<p>We will learn how Django interacts with the web which means the whole process of Django getting a request and giving a response.<\/p>\n<p>Ready to learn? Let\u2019s get started.<\/p>\n<h4>How does Web Work?<\/h4>\n<p>It&#8217;s simple yet a very important aspect to understand. So, basically, any application over the internet works by passing information. This information is often passed as objects. The objects mentioned here comprises of various files or properties. These objects can contain files as attachments.<\/p>\n<p>It is a very similar concept to emails.<\/p>\n<h4>HTTP<\/h4>\n<p>These interchanges between various servers and client machines following a set of rules. That set of rules is called HTTP. HTTP stands for <strong>HyperText Transfer Protocol<\/strong>. It&#8217;s simply a set of rules, a common standard followed by devices to connect to each other over the internet.<\/p>\n<p>The information sent or received is given the name of request and response.<br \/>\nRequest Objects contain the request made by the client. The server responds with the appropriate information according to Request Object.<\/p>\n<p>On the other hand, the Response Object is information served by the server to the client. It all makes sense now? Wait, there\u2019s still more:<\/p>\n<p>The below figure clearly explains how the web works. Well, it does that on a very high-level perspective. In this figure, both the client and server are using HTTP. If both of them don\u2019t have the same protocol, the connection can not be done.<\/p>\n<p>Just like humans need to have a common language to understand each other. The same way, various computers and machines over the internet need to have the same protocol. At least the one through which they communicate.<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/django-request-response.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-72267\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/django-request-response.jpg\" alt=\"django request response cycle\" width=\"802\" height=\"420\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/django-request-response.jpg 802w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/django-request-response-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/django-request-response-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/django-request-response-768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/django-request-response-520x272.jpg 520w\" sizes=\"auto, (max-width: 802px) 100vw, 802px\" \/><\/a><\/p>\n<h4>Request<\/h4>\n<p>Now, it&#8217;s time to understand Request. The requests are smaller in size than response. Basically, a Request is a \u201crequest made by the client\u201d to the server. Any URL that gets searched is a request.<\/p>\n<p>But, that\u2019s not the only type of Request. Request objects also give information to the server. The forms we fill, the images we upload to the server are also Requests. When we upload this information, it is transferred as attributes of the Request object.<\/p>\n<p>The server can then access that information and call its own functions.<\/p>\n<p>As you can see in the image, we have a request for <em>http:\/\/localhost:8000<\/em>. From that, we also get a response.<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/GET-Request.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-72273\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/GET-Request.png\" alt=\"GET Request - Django Request Response Cycle\" width=\"1532\" height=\"660\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/GET-Request.png 1532w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/GET-Request-150x65.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/GET-Request-300x129.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/GET-Request-768x331.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/GET-Request-1024x441.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/GET-Request-520x224.png 520w\" sizes=\"auto, (max-width: 1532px) 100vw, 1532px\" \/><\/a><\/p>\n<h4>Response<\/h4>\n<p>Responses are generally heavier in bandwidth than Request. The Response objects usually contain HTML, CSS, <em><strong>JavaScript<\/strong><\/em>, image, video files, etc. There are other files as well, which can be served by the server as a response. Response objects also have various parts.<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/Response-Object.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-72274\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/Response-Object.png\" alt=\"Response Object - Django Request Response Cycle\" width=\"1535\" height=\"304\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/Response-Object.png 1535w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/Response-Object-150x30.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/Response-Object-300x59.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/Response-Object-768x152.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/Response-Object-1024x203.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/Response-Object-520x103.png 520w\" sizes=\"auto, (max-width: 1535px) 100vw, 1535px\" \/><\/a><\/p>\n<p>This is the response object we actually get from the server. It has various parts to it. The response object we are discussing has 5 headers. Any response or request objects have a part to them called HTTP headers. These HTTP headers contain various information regarding the response.<\/p>\n<p>You can consider it as metadata of response objects. It tells the browser that from where the response came and what type of data it contains. There are many properties in the HTTP header.<\/p>\n<p>So, in the above example response, we can see the <strong>Content-Type <\/strong>attribute. That attribute\u2019s values are <strong>text\/html; charset=utf-8<\/strong>. This means that the response contains an HTML file.<\/p>\n<h3>Django Request-Response Cycle<\/h3>\n<p>Django\u2019s handling of Http Requests and Response is unique in its own ways.<\/p>\n<p>Django can be considered as an application on the server. Its main task is to process the request received by the server. Then it calls functions and provides a response. This is a brief of how Django interprets Request and provides Response.<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/Django-Middlewares.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-72275\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/Django-Middlewares.png\" alt=\"Django Middlewares - Django Request Response Cycle\" width=\"960\" height=\"357\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/Django-Middlewares.png 960w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/Django-Middlewares-150x56.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/Django-Middlewares-300x112.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/Django-Middlewares-768x286.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/Django-Middlewares-520x193.png 520w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/a><\/p>\n<p>Whenever a request comes into Django, it is handled by middlewares. When the Django server starts, the first thing it loads after settings.py is middlewares.<\/p>\n<p>The Request is processed by various middlewares one at a time. So, from the above list, when the request comes it will be passed through the security middleware. If it deems it to be unhealthy, then it will not let the request go any further.<\/p>\n<p>Otherwise, the authentication requests are handled by authentication middleware. That comes after 4 middleware classes that didn\u2019t find how to handle that request.<\/p>\n<p>Once, our request is processed by these middlewares it is passed to the <strong>URL Router<\/strong>. The URL router simply extracts the URL from the request and will try to match it to defined urls.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/urls-py-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-72276\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/urls-py-1.png\" alt=\"urls.py - Django request response cycle\" width=\"1920\" height=\"976\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/urls-py-1.png 1920w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/urls-py-1-150x76.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/urls-py-1-300x153.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/urls-py-1-768x390.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/urls-py-1-1024x521.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/urls-py-1-520x264.png 520w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/a><\/p>\n<p>Once, we get a matching URL, the corresponding view function is called. The view function will get various attributes and other URL parameters. Also, the view function will be able to access files from the requests. These Requests are considered to be HttpRequest class objects.<\/p>\n<p>The requests module is a <em><strong>Python module<\/strong><\/em> that provides various methods for Request objects.<\/p>\n<p>Once, the view function has been executed, it&#8217;s time to give a response. The response is given in the form of HttpResponse. The response is not limited to that. The Response can be PDF, JSON, CSV. That is one of the features of Django. It provides built-in support to provide responses of various types.<\/p>\n<p>When the response is a render, it will look for the HTML. The HTML page to be the server is processed by <em><strong>Django Templating Engine<\/strong><\/em>. Once that completes, the Django simply sends the files as any server would. That response will contain the HTML and other static files.<\/p>\n<p>Let&#8217;s take an example in which we will access the request data and print that in the server command line. Ultimately it&#8217;s just text.<\/p>\n<p>Here is the view function.<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/view-function.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-72277\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/view-function.png\" alt=\"view function - Django request &amp; response\" width=\"1920\" height=\"976\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/view-function.png 1920w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/view-function-150x76.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/view-function-300x153.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/view-function-768x390.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/view-function-1024x521.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/view-function-520x264.png 520w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/a><\/p>\n<p>When I run the server and request something in the browser, it will print this information on the command line.<\/p>\n<p>Here, you can see the command line output.<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/command-line-output.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-72278\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/command-line-output.png\" alt=\"command line output - Django request response cycle\" width=\"1920\" height=\"308\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/command-line-output.png 1920w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/command-line-output-150x24.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/command-line-output-300x48.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/command-line-output-768x123.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/command-line-output-1024x164.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/command-line-output-520x83.png 520w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/a><\/p>\n<p>As you can see, there are lots of information for a request like this.<\/p>\n<p><em>http:\/\/localhost:8000<\/em><\/p>\n<p>And since it&#8217;s also serving an HTML page, you can try these with any of your view functions.<\/p>\n<h3>Summary<\/h3>\n<p>I hope this article on the request and response cycle provided to be useful in your understanding of the Django framework. We understood how Django handles any request coming its way. The request handling of any framework is an important concept.<\/p>\n<p>Since we have been implementing the concepts in various projects, we need not develop a new one here. I hope you like this post.<\/p>\n<p>Clear with the Django request and response cycle? Mention your queries &amp; feedback in the comment section.<\/p>\n<p><em>Keep learning!<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>All backend technologies and web APIs are based on one system that is The Request-Response Cycle. The system is responsible for data interchange between client and servers. Even the new technologies based on micro-services&#46;&#46;&#46;<\/p>\n","protected":false},"author":6,"featured_media":72267,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19149],"tags":[21403,21402,21404,21405,21406],"class_list":["post-72247","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-django","tag-django-request-and-response","tag-django-request-response-cycle","tag-http","tag-request","tag-response"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Django Request-Response Cycle - An easy to follow guide - DataFlair<\/title>\n<meta name=\"description\" content=\"Django Request &amp; Response Cycle - Understand the complete cycle of handling Http Requests &amp; Response in Django with separate notes on terms of web working.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/django-request-response-cycle\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Django Request-Response Cycle - An easy to follow guide - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Django Request &amp; Response Cycle - Understand the complete cycle of handling Http Requests &amp; Response in Django with separate notes on terms of web working.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/django-request-response-cycle\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2019-11-07T06:08:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-06-21T06:49:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/django-request-response.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"802\" \/>\n\t<meta property=\"og:image:height\" content=\"420\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Django Request-Response Cycle - An easy to follow guide - DataFlair","description":"Django Request & Response Cycle - Understand the complete cycle of handling Http Requests & Response in Django with separate notes on terms of web working.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/django-request-response-cycle\/","og_locale":"en_US","og_type":"article","og_title":"Django Request-Response Cycle - An easy to follow guide - DataFlair","og_description":"Django Request & Response Cycle - Understand the complete cycle of handling Http Requests & Response in Django with separate notes on terms of web working.","og_url":"https:\/\/data-flair.training\/blogs\/django-request-response-cycle\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2019-11-07T06:08:49+00:00","article_modified_time":"2021-06-21T06:49:15+00:00","og_image":[{"width":802,"height":420,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/django-request-response.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/django-request-response-cycle\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/django-request-response-cycle\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/2c58ecb4f73a39f0ef993f1ddfcd7b89"},"headline":"Django Request-Response Cycle &#8211; An easy to follow guide","datePublished":"2019-11-07T06:08:49+00:00","dateModified":"2021-06-21T06:49:15+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/django-request-response-cycle\/"},"wordCount":1148,"commentCount":7,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/django-request-response-cycle\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/django-request-response.jpg","keywords":["Django Request and Response","django request response cycle","HTTP","Request","Response"],"articleSection":["Django Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/django-request-response-cycle\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/django-request-response-cycle\/","url":"https:\/\/data-flair.training\/blogs\/django-request-response-cycle\/","name":"Django Request-Response Cycle - An easy to follow guide - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/django-request-response-cycle\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/django-request-response-cycle\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/django-request-response.jpg","datePublished":"2019-11-07T06:08:49+00:00","dateModified":"2021-06-21T06:49:15+00:00","description":"Django Request & Response Cycle - Understand the complete cycle of handling Http Requests & Response in Django with separate notes on terms of web working.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/django-request-response-cycle\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/django-request-response-cycle\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/django-request-response-cycle\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/django-request-response.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/11\/django-request-response.jpg","width":802,"height":420,"caption":"django request response cycle"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/django-request-response-cycle\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Django Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/django\/"},{"@type":"ListItem","position":3,"name":"Django Request-Response Cycle &#8211; An easy to follow guide"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/2c58ecb4f73a39f0ef993f1ddfcd7b89","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"The DataFlair Team provides industry-driven content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our expert educators focus on delivering value-packed, easy-to-follow resources for tech enthusiasts and professionals.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam2\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/72247","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=72247"}],"version-history":[{"count":9,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/72247\/revisions"}],"predecessor-version":[{"id":97542,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/72247\/revisions\/97542"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/72267"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=72247"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=72247"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=72247"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}