

{"id":113286,"date":"2023-07-27T19:03:11","date_gmt":"2023-07-27T13:33:11","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=113286"},"modified":"2023-07-27T19:03:46","modified_gmt":"2023-07-27T13:33:46","slug":"flask-session","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/flask-session\/","title":{"rendered":"How to Use Session in Flask?"},"content":{"rendered":"<p>In this tutorial, we will learn about session in flask with example, its working, uses and much more. Let&#8217;s start!!!<\/p>\n<h3>Session in Flask<\/h3>\n<p>Session data in flask is saved on the client, just as cookies. A client&#8217;s time spent logging in and out of a server is known as a session. The client browser stores the data that must be kept around for this session. Each client&#8217;s session is given a unique Session ID. The persistent data is kept on account of cookies and is cryptographically signed by the server. A defined SECRET KEY is required by a Flask application for this encryption.<\/p>\n<p>A dictionary object called a session object also contains key-value pairs for session variables and their corresponding values. Your application will now support Server-side Session thanks to the Flask-Session extension. If you&#8217;re using an earlier version of Flask, see Compatibility for Old and New Sessions. Flask 0.8 or later is required.<\/p>\n<p>A Flask addon called Flask-Session allows your application to handle server-side sessions. The period of time between a client&#8217;s initial login and their final logout is known as a session. The information that must be stored in the session is kept on the server in a temporary directory.<\/p>\n<p>The server cryptographically signs the data in the Session and stores it on top of cookies. Each customer will have a separate session where their unique data will be saved.<\/p>\n<p>A cookie and a session both have very similar concepts. The session data, however, is kept on the server. The period of time between a user&#8217;s login and logout on the server is known as a session. The transient subdirectory on the server is where the information needed to monitor this session is kept. The session data is kept on top of cookies and cryptographically signed by the server.<\/p>\n<p>In Flask, a session object is used to track session data. The session object is essentially a dictionary entity that contains key-value pairs of session parameters and their associated values. This allows the Flask application to maintain state across multiple requests from the same client. The session object can be used to store data that needs to be persisted across requests, such as user authentication status or shopping cart contents. It is a powerful feature of Flask that enables developers to build more sophisticated web applications with a greater degree of interactivity and personalization.<\/p>\n<p>Use the statement, for instance, to set the session variable &#8220;username.&#8221;<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Session[\u2018username\u2019] = \u2018applicant\u2019\r\n<\/pre>\n<p>The pop() method is useful to remove a session variable.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">session.pop('username', None)\r\n<\/pre>\n<p>Use the command below to install the extension.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">$ pip install Flask-Session\r\n<\/pre>\n<h3>Setting up a Session in Flask<\/h3>\n<p>Direct access is not made use of with the Session instance. Always make use of flask session. Each of us as users get our own copy of the session thanks to the initial line from the flask&#8217;s design.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">from flask import Flask, render_template, redirect, request, session\r\nfrom flask_session import Session\r\n<\/pre>\n<p>You should never use the Session object directly; instead, use flask.session:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">from flask import Flask, session\r\nfrom flask.ext.session import Session\r\ndata = Flask(__name__)\r\n# Check Configuration section for more details\r\nSESSION_TYPE = 'redis'\r\napp.config.from_object(__name__)\r\nSession(data)\r\n@app.route('\/set\/')\r\ndef setting():\r\n    session['key'] = 'value'\r\n    return 'okay'\r\n@app.route('\/get\/')\r\ndef getting():\r\n    return session.get('key', 'not fixed')\r\n<\/pre>\n<h3>IIlustration<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">from flask import *  \r\napplication = Flask(__name__)  \r\napplication.secret_key = \"abc\"  \r\n@application .route('\/')  \r\ndef demo():  \r\n    result = make_response(\"&lt;h4&gt;session variable is set, &lt;a href='\/get'&gt;Variable&lt;\/a&gt;&lt;\/h4&gt;\")  \r\n    session['response']='session#1'  \r\n    return result ;  \r\n@application route('\/get')  \r\ndef get():  \r\n    if 'response' in session:  \r\n        s = session['response'];  \r\n        return render_template('first.html',name = s)  \r\nif __name__ == '__main__':  \r\n    application .run(debug = True) \r\n<\/pre>\n<h4>first.html<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;html&gt;  \r\n&lt;head&gt;  \r\n&lt;title&gt;getting the session&lt;\/title&gt;  \r\n&lt;\/head&gt;  \r\n&lt;body&gt;  \r\n&lt;p&gt;The session's value is set to: &lt;strong&gt;{{title}}&lt;\/strong&gt;&lt;\/p&gt;  \r\n&lt;\/body&gt;  \r\n&lt;\/html&gt;\r\n<\/pre>\n<h3>Using Sessions, log into the flask&#8217;s application.<\/h3>\n<p>Here, we&#8217;ll build a login app in a flask that displays the user the following home page. We cannot browse the account directly without logging in, thus if we click view profile without first logging in, a warning will appear.<\/p>\n<p>When a user visits the login page, the application displays the screen where the user must input their email address and password. Now, our application sends the user to the success page after receiving any random, legitimate email address and password.<\/p>\n<p>The session is implemented via this straightforward login application, which was created with Python Flask. The main controller in this case is the Flask script login.py, which has the view methods home(), login(), success(), logout(), and profile() that are connected to the corresponding URL mappings (\/, \/sign_in, \/successful, \/sign_out, and \/account).<\/p>\n<h4>login.py<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">from flask import *  \r\napplication = Flask(__name__)  \r\napplication.secret_key = \"ayush\"  \r\n@application.route('\/')  \r\ndef demo():  \r\n    return render_template(\"demo.html\")  \r\n@application.route('\/sign_in')  \r\ndef sign_in():  \r\n    return render_template(\"sign_in.html\")  \r\n@app.route('\/success',methods = [\"POST\"])  \r\ndef successful():  \r\n    if request.method == \"POST\":  \r\n        session['email']=request.form['email']  \r\n    return render_template('successful.html')  \r\n@app.route('\/sign_out')  \r\ndef sign_out():  \r\n    if 'email' in session:  \r\n        session.pop('email',None)  \r\n        return render_template('sign_out.html');  \r\n    else:  \r\n        return '&lt;p&gt;Signed out successfully&lt;\/p&gt;'  \r\n@application.route('\/profile')  \r\ndef account():  \r\n    if 'email' in session:  \r\n        email = session['email']  \r\n        return render_template('account.html',name=email)  \r\n    else:  \r\n        return '&lt;p&gt;Log in&lt;\/p&gt;'  \r\nif __name__ == '__main__':  \r\n    application.run(debug = True)\r\n<\/pre>\n<h4>demo.html<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;html&gt;  \r\n&lt;head&gt;  \r\n&lt;title&gt;demo&lt;\/title&gt;  \r\n&lt;\/head&gt;  \r\n&lt;body&gt;  \r\n&lt;h3&gt;Hello World&lt;\/h3&gt;  \r\n&lt;a href = \"\/sign_in\"&gt;sign_in&lt;\/a&gt;&lt;br&gt;  \r\n&lt;a href = \"\/account\"&gt;Access Account&lt;\/a&gt;&lt;br&gt;  \r\n&lt;a href = \"\/logout\"&gt;Log out&lt;\/a&gt;&lt;br&gt;  \r\n&lt;\/body&gt;  \r\n&lt;\/html&gt;  \r\n<\/pre>\n<h4>login.html<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;html&gt;  \r\n&lt;head&gt;  \r\n    &lt;title&gt;Sign_in&lt;\/title&gt;  \r\n&lt;\/head&gt;  \r\n&lt;body&gt;  \r\n    &lt;form method = \"post\" action = \"http:\/\/localhost:5000\/success\"&gt;  \r\n        &lt;table&gt;  \r\n            &lt;tr&gt;&lt;td&gt;Email Id&lt;\/td&gt;&lt;td&gt;&lt;input type = 'email' name = 'email'&gt;&lt;\/td&gt;&lt;\/tr&gt;  \r\n            &lt;tr&gt;&lt;td&gt;Passcode&lt;\/td&gt;&lt;td&gt;&lt;input type = 'password' name = 'Passcode'&gt;&lt;\/td&gt;&lt;\/tr&gt;  \r\n            &lt;tr&gt;&lt;td&gt;&lt;input type = \"submit\" value = \"Accept\"&gt;&lt;\/td&gt;&lt;\/tr&gt;  \r\n        &lt;\/table&gt;  \r\n    &lt;\/form&gt;  \r\n&lt;\/body&gt;  \r\n&lt;\/html&gt; \r\n<\/pre>\n<h4>successful.html<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;html&gt;  \r\n&lt;head&gt;  \r\n&lt;title&gt;Successful&lt;\/title&gt;  \r\n&lt;\/head&gt;  \r\n&lt;body&gt;  \r\n    &lt;h2&gt;Sign in successful&lt;\/h2&gt;  \r\n    &lt;a href=\"\/profile\"&gt;View Account&lt;\/a&gt;  \r\n&lt;\/body&gt;  \r\n&lt;\/html&gt;  \r\nsign_out.html\r\n&lt;html&gt;  \r\n&lt;head&gt;  \r\n    &lt;title&gt;Sign out&lt;\/title&gt;  \r\n&lt;\/head&gt;  \r\n&lt;body&gt;  \r\n&lt;p&gt;Signed Out Successfully Click &lt;a href=\"\/login\"&gt;here&lt;\/a&gt; to Sign in again&lt;\/p&gt;  \r\n&lt;\/body&gt;  \r\n&lt;\/html&gt;\r\n<\/pre>\n<h4>sign_out.html<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;html&gt;  \r\n&lt;head&gt;  \r\n    &lt;title&gt;Sign out&lt;\/title&gt;  \r\n&lt;\/head&gt;  \r\n&lt;body&gt;  \r\n&lt;p&gt;Signed Out Successfully Click &lt;a href=\"\/login\"&gt;here&lt;\/a&gt; to Sign in again&lt;\/p&gt;  \r\n&lt;\/body&gt;  \r\n&lt;\/html&gt;\r\n<\/pre>\n<h3>Uses of sessions in Flask<\/h3>\n<p>Sessions are an important feature of Flask that allow developers to store data across multiple requests from the same client. Here are some common use cases for sessions in Flask:<\/p>\n<p><strong>1. User authentication:<\/strong> Sessions can be used to keep track of whether a user is logged in or not, and to store information about the user such as their username or role.<\/p>\n<p><strong>2. Shopping carts:<\/strong> Sessions can be used to store items that a user has added to their shopping cart, so that the items are preserved across different pages of the site.<\/p>\n<p><strong>3. Form data:<\/strong> Sessions can be used to store data that a user has entered into a form, so that it is not lost when the user navigates away from the page.<\/p>\n<p><strong>4. Customization:<\/strong> Sessions can be used to store user preferences or settings, such as the user&#8217;s preferred language or display options.<\/p>\n<p><strong>5. Analytics:<\/strong> Sessions can be used to track user behavior and activity across multiple requests, which can be useful for generating analytics and insights.<\/p>\n<h3>How does the session work in Flask?<\/h3>\n<p>In Flask, sessions work by using a client-side cookie to store a unique session ID for each user. When a user makes a request to the Flask application, the server checks if a session cookie exists. If it doesn&#8217;t, a new session ID is generated and stored in a cookie on the user&#8217;s browser.<\/p>\n<p>The session ID is used to associate subsequent requests from the same user with their session data, which is stored on the server-side. This allows the Flask application to keep track of user state across multiple requests.<\/p>\n<p>To store data in a session, developers can use the session object provided by Flask. This object behaves like a dictionary, allowing developers to store and retrieve data using keys and values.<\/p>\n<p>For example, to store a user&#8217;s name in a session, you could use the following code:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">from flask import session\r\n\r\nsession['username'] = 'Alice'\r\n<\/pre>\n<p>To retrieve the user&#8217;s name from the session in a subsequent request, you could use the following code:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">from flask import session\r\n\r\nusername = session.get('username')\r\n<\/pre>\n<p>It&#8217;s important to note that the data stored in a session is stored on the server-side, and is not accessible to the client. Only the session ID is stored in the client-side cookie. This helps to prevent security issues such as session hijacking and data tampering.<\/p>\n<p>Overall, sessions are a powerful tool for building dynamic, personalized web applications in Flask. They allow developers to create applications that remember and respond to user behavior, preferences, and actions, leading to a more engaging and interactive user experience.<\/p>\n<h3>Conclusion<\/h3>\n<p>A flask session is a method used in the flask utility that serves as an addition to support identities in the server-side of the flask application created. In a nutshell, Flask is a minimal framework, or microframework, that enables the development of online applications. With the exception of the reality the session data is kept on a server, the notion of a session in Flask is quite comparable to the concept of a cookie.<\/p>\n<p>Session data contains an identifier to identify the networked machine.A dictionary object is used to store key-value pairs of session variables and their corresponding values. This dictionary is used to instantiate an object which contains the session data. The dictionary allows easy access to the session variables and their values. It is a convenient way to store and manage session data in a web application. The session object can be used to persist data across multiple requests, and can be accessed by the server-side code to perform various tasks based on the session data.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we will learn about session in flask with example, its working, uses and much more. Let&#8217;s start!!! Session in Flask Session data in flask is saved on the client, just as&#46;&#46;&#46;<\/p>\n","protected":false},"author":581,"featured_media":114835,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27373],"tags":[27635],"class_list":["post-113286","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python-flask-tutorials","tag-session-in-flask"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Use Session in Flask? - DataFlair<\/title>\n<meta name=\"description\" content=\"Session is a method in flask utility that serves as an addition to support identities in the server-side of the flask application. Learn more\" \/>\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\/flask-session\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Use Session in Flask? - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Session is a method in flask utility that serves as an addition to support identities in the server-side of the flask application. Learn more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/flask-session\/\" \/>\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=\"2023-07-27T13:33:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-07-27T13:33:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/flask-sessions.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\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=\"6 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Use Session in Flask? - DataFlair","description":"Session is a method in flask utility that serves as an addition to support identities in the server-side of the flask application. Learn more","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\/flask-session\/","og_locale":"en_US","og_type":"article","og_title":"How to Use Session in Flask? - DataFlair","og_description":"Session is a method in flask utility that serves as an addition to support identities in the server-side of the flask application. Learn more","og_url":"https:\/\/data-flair.training\/blogs\/flask-session\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2023-07-27T13:33:11+00:00","article_modified_time":"2023-07-27T13:33:46+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/flask-sessions.webp","type":"image\/webp"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/flask-session\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/flask-session\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/c187795dc82ab948373cca526df7c445"},"headline":"How to Use Session in Flask?","datePublished":"2023-07-27T13:33:11+00:00","dateModified":"2023-07-27T13:33:46+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/flask-session\/"},"wordCount":1244,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/flask-session\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/flask-sessions.webp","keywords":["Session in Flask"],"articleSection":["Python Flask Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/flask-session\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/flask-session\/","url":"https:\/\/data-flair.training\/blogs\/flask-session\/","name":"How to Use Session in Flask? - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/flask-session\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/flask-session\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/flask-sessions.webp","datePublished":"2023-07-27T13:33:11+00:00","dateModified":"2023-07-27T13:33:46+00:00","description":"Session is a method in flask utility that serves as an addition to support identities in the server-side of the flask application. Learn more","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/flask-session\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/flask-session\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/flask-session\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/flask-sessions.webp","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/03\/flask-sessions.webp","width":1200,"height":628,"caption":"flask sessions"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/flask-session\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Python Flask Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/python-flask-tutorials\/"},{"@type":"ListItem","position":3,"name":"How to Use Session in Flask?"}]},{"@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\/c187795dc82ab948373cca526df7c445","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/2302ebc438084d2f1f993edc1996a0aae01332e81f3227cba8df0c48ec010ca4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/2302ebc438084d2f1f993edc1996a0aae01332e81f3227cba8df0c48ec010ca4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2302ebc438084d2f1f993edc1996a0aae01332e81f3227cba8df0c48ec010ca4?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team provides high-impact content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. We make complex concepts easy to grasp, helping learners of all levels succeed in their tech careers.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam6\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/113286","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\/581"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=113286"}],"version-history":[{"count":6,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/113286\/revisions"}],"predecessor-version":[{"id":116957,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/113286\/revisions\/116957"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/114835"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=113286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=113286"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=113286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}