

{"id":113297,"date":"2023-07-22T09:00:56","date_gmt":"2023-07-22T03:30:56","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=113297"},"modified":"2023-04-25T14:32:47","modified_gmt":"2023-04-25T09:02:47","slug":"flask-flashing","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/flask-flashing\/","title":{"rendered":"Flask Flashing \u2013 A Simple Way to Send Messages to Users"},"content":{"rendered":"<p>In web development, sending messages to users is an essential part of the user experience. Flask provides a simple way to send messages to users using the flash() function. In this article, we will explore Flask flashing, how to use it, and its benefits.<\/p>\n<h3>What is Flask Flashing?<\/h3>\n<p>Flask flashing is a feature that allows developers to send messages to users, usually in response to some user action. These messages are often used to inform users about the success or failure of a particular operation or to provide feedback about the system&#8217;s status.<\/p>\n<p>Using Flask flashing, we can send messages of different types, such as success, error, warning, and info messages. Flask flashing is a simple way to provide users with feedback about their actions on the website.<\/p>\n<h3>How to Use Flask Flashing?<\/h3>\n<p>To use Flask flashing, we need to follow three simple steps:<\/p>\n<h4>Step 1: Import the Flash module<\/h4>\n<p>We need to import the flash() function from the Flask module. We can do this by adding the following code to our Python file:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">from flask import Flask, flash\r\n<\/pre>\n<h4>Step 2: Add Messages to Flash<\/h4>\n<p>Once we have imported the flash() function, we can add messages to the flash object. We can do this by calling the flash() function and passing it the message we want to display to the user. We can add a message to the flash object by using the following code:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">@app.route('\/login', methods=['POST'])\r\ndef login():\r\n    username = request.form['username']\r\n    password = request.form['password']\r\n    if username == 'admin' and password == 'password':\r\n        flash('You were successfully logged in')\r\n        return redirect(url_for('index'))\r\n    else:\r\n        flash('Invalid username\/password')\r\n        return redirect(url_for('login'))\r\n<\/pre>\n<p>In this code snippet, we add two messages to the flash object, depending on whether the user logs in successfully or not.<\/p>\n<h4>Step 3: Display Messages to the User<\/h4>\n<p>Once we have added messages to the flash object, we can display them to the user. We can do this by adding the following code to our HTML template:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">{% with messages = get_flashed_messages() %}\r\n    {% if messages %}\r\n        &lt;ul class=flashes&gt;\r\n        {% for message in messages %}\r\n            &lt;li&gt;{{ message }}&lt;\/li&gt;\r\n        {% endfor %}\r\n        &lt;\/ul&gt;\r\n    {% endif %}\r\n{% endwith %}\r\n<\/pre>\n<p>This code snippet retrieves the messages from the flash object and displays them in an unordered list on the web page.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/07\/display-messages-to-users.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-114768\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/07\/display-messages-to-users.webp\" alt=\"display messages to users\" width=\"1806\" height=\"950\" \/><\/a><\/p>\n<h3>How does Flask flash work?<\/h3>\n<p>The flash method, which enables developers to show messages to users, is one of the many useful features of Flask. When using Flash, programmers can make a flash message in one Flask View and display it in the &#8220;next&#8221; View, which is typically a template View. The page that the user views is called the template view, and it is in charge of showing the data that the Flask View sends.<\/p>\n<p>For instance, a normal Template View would resemble the following:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">@app.route('\/template')\r\ndef blog():\r\n    #codes...\r\n    #codes...\r\n    return render_template('template.html')\r\n<\/pre>\n<p>In this instance, a Flask View generates a Flash message in one view and passes it on to the following view, which displays the message to the user while also receiving the request.<\/p>\n<p>The syntax for Flash is simple:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">flash(message, category)\r\n<\/pre>\n<p>The message that will be displayed in this case is message, and category is an optional parameter that can be assigned to &#8220;error,&#8221; &#8220;info,&#8221; or &#8220;warning.&#8221;<\/p>\n<p>Developers use the get flashed messages() method to retrieve the flash message from the session, where it is stored, and show it on the template.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">get_flashed_messages(with_categories, category_filter)\r\n<\/pre>\n<p>Here, category filter is an optional parameter that allows you to filter and show only particular messages. with categories is an optional parameter tuple that specifies the category (error\/info\/warning).<\/p>\n<p>To display the flashed message in a template, the following code can be used:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">{% with messages = get_flashed_messages() %}\r\n   {% if messages %}\r\n      {% for message in messages %}\r\n         {{ message }}\r\n      {% endfor %}\r\n   {% endif %}\r\n{% endwith %}\r\n<\/pre>\n<p>The flashed message is taken out of the session by this code, and it is then displayed in the template.<\/p>\n<p>In conclusion, Flask&#8217;s flash method and get flashed messages() function enable developers to seamlessly make and present messages to users. These tools and techniques enable developers to give users insightful input, enhancing the user experience as a whole.<\/p>\n<h3>Advanatages of Flask Flashing<\/h3>\n<p>Flask flashing has several benefits:<\/p>\n<p><strong>1. Simple to use:<\/strong> Flask flashing is a simple and effective way to send messages to users.<\/p>\n<p><strong>2. Provides feedback:<\/strong> Flask flashing provides feedback to users about the success or failure of their actions.<\/p>\n<p><strong>3. Improves user experience:<\/strong> Flask flashing improves the user experience by providing real-time feedback to users.<\/p>\n<p><strong>4. Customizable:<\/strong> Flask flashing is customizable, allowing developers to change the look and feel of the messages.<\/p>\n<p><strong>Code example for Flask flashing:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">from flask import Flask, render_template, request, redirect, url_for, flash\r\n\r\napp = Flask(__name__)\r\napp.secret_key = \"mysecretkey\"\r\n\r\n@app.route('\/')\r\ndef home():\r\n    return render_template('home.html')\r\n\r\n@app.route('\/login', methods=['POST'])\r\ndef login():\r\n    username = request.form['username']\r\n    password = request.form['password']\r\n    if username == 'admin' and password == 'password':\r\n        flash('You were successfully logged in', 'success')\r\n        return redirect(url_for('home'))\r\n    else:\r\n        flash('Invalid username\/password', 'error')\r\n        return redirect(url_for('home'))\r\n\r\nif __name__ == '__main__':\r\n    app.run(debug=True)\r\n<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/07\/flask-flashing.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-114769\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/07\/flask-flashing.webp\" alt=\"flask flashing\" width=\"1806\" height=\"960\" \/><\/a><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/07\/flask-flashing-details.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-114770\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/07\/flask-flashing-details.webp\" alt=\"flask flashing details\" width=\"1804\" height=\"952\" \/><\/a><\/p>\n<h3>Flask Flashing with Categories<\/h3>\n<p>It&#8217;s crucial to give users feedback when creating web applications so they can understand whether a particular action was effective or if there was a problem. Flashing messages, which are messages that are displayed to the user for a brief time before disappearing, are one method to give this feedback.<\/p>\n<p>Flashed messages have the category &#8220;message&#8221; by default, but it is possible to use different categories to give greater feedback. To make error messages stick out, they could, for instance, be displayed with a red background.<\/p>\n<p>The flash() function&#8217;s second argument can be used to flash a message with a distinct category:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">flash('Invalid password provided', 'error')\r\n<\/pre>\n<p>The get flashed messages() function needs to be instructed in the template to yield the categories as well. The message and topic can then be displayed together in the loop that displays the messages.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">{% with messages = get_flashed_messages(with_categories=true) %}\r\n  {% if messages %}\r\n    &lt;ul class=flashes&gt;\r\n    {% for category, message in messages %}\r\n      &lt;li class=\"{{ category }}\"&gt;{{ message }}&lt;\/li&gt;\r\n    {% endfor %}\r\n    &lt;\/ul&gt;\r\n  {% endif %}\r\n{% endwith %}\r\n<\/pre>\n<p>This is just one example of how to render these flashed messages. One might also use the category to add a prefix such as &lt;strong&gt;Error:&lt;\/strong&gt; to the message.<\/p>\n<p>Overall, flashing messages with different categories can provide better feedback to the user and make it easier to differentiate between different types of messages.<\/p>\n<h3>Filtering Flash Messages<\/h3>\n<p>It&#8217;s frequently helpful to have the option to filter the messages by topic when using flashed messages in a web application. You can accomplish this by providing the get flashed messages() function with a collection of categories.<\/p>\n<p>For instance, you could use the following code in your template to show all error messages in a separate block from other messages:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">{% with errors = get_flashed_messages(category_filter=[\"error\"]) %}\r\n{% if errors %}\r\n&lt;div class=\"alert-message block-message error\"&gt;\r\n  &lt;a class=\"close\" href=\"#\"&gt;\u00d7&lt;\/a&gt;\r\n  &lt;ul&gt;\r\n    {%- for msg in errors %}\r\n    &lt;li&gt;{{ msg }}&lt;\/li&gt;\r\n    {% endfor -%}\r\n  &lt;\/ul&gt;\r\n&lt;\/div&gt;\r\n{% endif %}\r\n{% endwith %}\r\n<\/pre>\n<p>In this case, the category filter argument is used to filter the flashed messages to only include those with a category of &#8220;error&#8221;. After being looped through, the filtered communications are then shown in a separate block with a different CSS class.<\/p>\n<p>Using category filtering can make it simpler to distinguish between various message types and to give the user feedback that is more specifically targeted.<\/p>\n<h3>Types of Flask flash messages<\/h3>\n<p>Flask supports different types of flash messages that can be used to distinguish between different types of messages. The most common types are &#8216;success&#8217;, &#8216;error&#8217;, &#8216;warning&#8217;, and &#8216;info&#8217;. Each type of message can be styled differently, making it easy to differentiate between different types of messages.<\/p>\n<h3>Flask flashing best practices<\/h3>\n<p>Here are some best practices for using Flask flashing:<\/p>\n<ul>\n<li>Use descriptive message types that clearly communicate the purpose of the message.<\/li>\n<li>Keep messages short and to the point.<\/li>\n<li>Use consistent message formatting throughout the application.<\/li>\n<li>Use message categories to group related messages together.<\/li>\n<li>Use flash messages sparingly to avoid overwhelming the user.<\/li>\n<li>Avoid displaying sensitive information in flash messages.<\/li>\n<\/ul>\n<h3>Flask flashing examples and use cases<\/h3>\n<p>Here are some examples and use cases for Flask flashing:<\/p>\n<ul>\n<li>Displaying success or error messages after a form submission.<\/li>\n<li>Providing feedback to users during user authentication.<\/li>\n<li>Displaying informative messages to users, such as confirmation messages or error messages.<\/li>\n<li>Providing feedback to users during long-running processes, such as file uploads or database operations.<\/li>\n<\/ul>\n<h3>Flask flashing with forms and user authentication<\/h3>\n<p>Flask flashing is often used with forms and user authentication. When a user submits a form, Flask flashing can be used to display a success or error message based on the outcome of the form submission. During user authentication, Flask flashing can provide feedback to users by displaying error messages when an incorrect username or password is entered. This helps users understand what went wrong and how to correct the error.<\/p>\n<h3>Flask flashing and Ajax requests<\/h3>\n<p>Flask flashing can be used with Ajax requests to provide real-time feedback to users without refreshing the page. When an Ajax request is made, Flask flashing can be used to display a success or error message based on the outcome of the request.<\/p>\n<h3>Flask flashing and Bootstrap integration<\/h3>\n<p>Flask flashing can be easily integrated with Bootstrap, a popular front-end framework. Bootstrap provides built-in support for displaying alert messages, which can be used to display Flask flash messages. This makes it easy to style Flask flash messages in a consistent and visually appealing way.<\/p>\n<h3>Flask flashing with redirects<\/h3>\n<p>Flask flashing can be used with redirects to display flash messages on a different page than the one where the action occurred. It can display success or error messages to users when they submit a form on one page and are redirected to another. This makes it easier for users to understand what has happened and provides a better user experience.<\/p>\n<p>To use Flask flashing with redirects, simply call the flash() function before the redirect:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">@app.route('\/submit-form', methods=['POST'])\r\ndef submit_form():\r\n    # process form data here\r\n    flash('Form submitted successfully')\r\n    return redirect(url_for('success'))\r\n<\/pre>\n<p>Then, on the new page, use the get_flashed_messages() function to display the flash message:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n    &lt;title&gt;Success Page&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n    {% with messages = get_flashed_messages() %}\r\n        {% if messages %}\r\n            &lt;ul class=flashes&gt;\r\n            {% for message in messages %}\r\n                &lt;li&gt;{{ message }}&lt;\/li&gt;\r\n            {% endfor %}\r\n            &lt;\/ul&gt;\r\n        {% endif %}\r\n    {% endwith %}\r\n    &lt;h1&gt;Success Page&lt;\/h1&gt;\r\n    &lt;!-- rest of the page content here --&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/07\/success-page.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-114771\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/07\/success-page.webp\" alt=\"success page\" width=\"1800\" height=\"952\" \/><\/a><\/p>\n<h3>Conclusion<\/h3>\n<p>In conclusion, Flask flashing is a useful feature in Flask web applications that allows developers to provide real-time feedback to users. By displaying flash messages, developers can communicate the success or failure of user actions and improve the overall usability of their web application. Flask flashing is a simple and customizable way to display messages in Flask web applications. It can be used to display messages on different pages, support internationalisation and localization, and for testing purposes. Using Flask flashing can make web applications more responsive and user-friendly, leading to a better user experience.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In web development, sending messages to users is an essential part of the user experience. Flask provides a simple way to send messages to users using the flash() function. In this article, we will&#46;&#46;&#46;<\/p>\n","protected":false},"author":581,"featured_media":114765,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27373],"tags":[27622,27623],"class_list":["post-113297","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python-flask-tutorials","tag-flask-flashing","tag-flask-method-in-flask"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Flask Flashing \u2013 A Simple Way to Send Messages to Users - DataFlair<\/title>\n<meta name=\"description\" content=\"Flask flashing is a feature in Flask web applications that allows developers to provide real-time feedback to users. Learn more with example.\" \/>\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-flashing\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Flask Flashing \u2013 A Simple Way to Send Messages to Users - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Flask flashing is a feature in Flask web applications that allows developers to provide real-time feedback to users. Learn more with example.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/flask-flashing\/\" \/>\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-22T03:30:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/04\/flask-flashing.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=\"9 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Flask Flashing \u2013 A Simple Way to Send Messages to Users - DataFlair","description":"Flask flashing is a feature in Flask web applications that allows developers to provide real-time feedback to users. Learn more with example.","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-flashing\/","og_locale":"en_US","og_type":"article","og_title":"Flask Flashing \u2013 A Simple Way to Send Messages to Users - DataFlair","og_description":"Flask flashing is a feature in Flask web applications that allows developers to provide real-time feedback to users. Learn more with example.","og_url":"https:\/\/data-flair.training\/blogs\/flask-flashing\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2023-07-22T03:30:56+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/04\/flask-flashing.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":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/flask-flashing\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/flask-flashing\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/c187795dc82ab948373cca526df7c445"},"headline":"Flask Flashing \u2013 A Simple Way to Send Messages to Users","datePublished":"2023-07-22T03:30:56+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/flask-flashing\/"},"wordCount":1542,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/flask-flashing\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/04\/flask-flashing.webp","keywords":["flask flashing","flask method in flask"],"articleSection":["Python Flask Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/flask-flashing\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/flask-flashing\/","url":"https:\/\/data-flair.training\/blogs\/flask-flashing\/","name":"Flask Flashing \u2013 A Simple Way to Send Messages to Users - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/flask-flashing\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/flask-flashing\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/04\/flask-flashing.webp","datePublished":"2023-07-22T03:30:56+00:00","description":"Flask flashing is a feature in Flask web applications that allows developers to provide real-time feedback to users. Learn more with example.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/flask-flashing\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/flask-flashing\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/flask-flashing\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/04\/flask-flashing.webp","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/04\/flask-flashing.webp","width":1200,"height":628,"caption":"flask flashing"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/flask-flashing\/#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":"Flask Flashing \u2013 A Simple Way to Send Messages to Users"}]},{"@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\/113297","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=113297"}],"version-history":[{"count":7,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/113297\/revisions"}],"predecessor-version":[{"id":114772,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/113297\/revisions\/114772"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/114765"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=113297"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=113297"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=113297"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}