{"id":40230,"date":"2021-07-21T12:46:15","date_gmt":"2021-07-21T07:16:15","guid":{"rendered":"https:\/\/www.mygreatlearning.com\/blog\/everything-you-need-to-know-about-flask-for-beginners\/"},"modified":"2024-10-14T23:56:23","modified_gmt":"2024-10-14T18:26:23","slug":"everything-you-need-to-know-about-flask-for-beginners","status":"publish","type":"post","link":"https:\/\/www.mygreatlearning.com\/blog\/everything-you-need-to-know-about-flask-for-beginners\/","title":{"rendered":"Everything you need to know about Flask for beginners."},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"introduction\"><strong>Introduction<\/strong><\/h2>\n\n\n\n<p>Python is the most sort after language for web application development and data science as well. It has risen to this height for its ease of use and variety of supportive libraries. There are legacy frameworks like Java\u2019s Enterprise edition and ASP. NET\u2019s MVC framework is still popular for enterprise-level development. But Python is the favourite for new POC and small-time development where an audience that of an enterprise is not immediately expected. And, of course, the fact that Python and most of its libraries are open sources and free is an exceptionally helpful and useful factor too.&nbsp;<\/p>\n\n\n\n<p>In Python, for web application development, the leaders are <a href=\"https:\/\/www.mygreatlearning.com\/blog\/django-tutorial\/\" target=\"_blank\" rel=\"noreferrer noopener\">Django<\/a> and Flask. Django is very much similar to the MVC framework of ASP. NET. But Flask is different. Let\u2019s see how.&nbsp;Read further and learn more about <a href=\"https:\/\/www.mygreatlearning.com\/academy\/learn-for-free\/courses\/machine-learning-model-deployment-using-flask\" target=\"_blank\" rel=\"noreferrer noopener\">machine learning deployment<\/a> using flask and get practical insights.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-a-web-framework\"><strong>What is a Web Framework?<\/strong><\/h2>\n\n\n\n<p>To understand Flask, we need to understand what is the traditional web framework.&nbsp;A web application framework is a collection of libraries and modules which helps developers write the business layer without worrying about the protocol, thread management, etc. And Python\u2019s Django follows a traditional web framework which is also called an enterprise framework.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-micro-framework\"><strong>What is Micro-framework?<\/strong><\/h2>\n\n\n\n<p>In contrast to a traditional web framework, a micro-framework is a minimalistic framework where developers are provided with a lot of freedom to build the web application layer. As compared to an enterprise framework, a developer would not need to set up many things in a micro-framework to get the web app hosted and running. This is incredibly useful in cases of small web app development where the needs are not the same as an enterprise-level framework which would save lots of development ~ maintenance time and money as a consequence.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-flask\"><strong>What is Flask?<\/strong><\/h2>\n\n\n\n<p>Now, we are well equipped to understand Flask. Flask is Python\u2019s micro-framework for web app development. It was developed by <strong>Armin Ronacher<\/strong>, who led an international team of Python enthusiasts called Pocco. Flask consists of Werkzeug WSGI toolkit and Jinja2 template engine. Both were also developed by Pocco. It was initially released in April 2010. Currently, the latest version as of writing this article is 2.0.2.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-wsgi\"><strong>What is WSGI?<\/strong><\/h2>\n\n\n\n<p>Web Server Gateway Interface (WSGI) is the standard for Python web application development. WSGI is a specification for a universal interface between the web server and the web applications.&nbsp;&nbsp;<\/p>\n\n\n\n<p>Werkzeug is one of the most advanced WSGI modules that contain various tools and utilities that facilitate web application development. Flask implements Werkzeug.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-jinja-2\"><strong>What is Jinja 2?<\/strong><\/h2>\n\n\n\n<p>Jinja 2 is a template rendering engine. It renders the web pages for the server with any specified custom content given to it by the webserver. Flask renders its HTML based templates using Jinja 2.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"why-flask\"><strong>Why Flask?<\/strong><\/h2>\n\n\n\n<p>Now, you would be able to understand, when we define Flask as a micro-framework that is built using WSGI and Jinja 2 template engine.&nbsp;<\/p>\n\n\n\n<p>Major advantages of Flask are:&nbsp;<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Ease of setup and use.<\/li><li>Freedom to build the structure of the web application.&nbsp;<\/li><\/ol>\n\n\n\n<p>With freedom comes responsibility, similarly, Flask needs the developers to carefully structure it, since Flask doesn\u2019t have \u201cflask rules\u201d to follow as compared to frameworks like Django. As the web app increases in complexity, this structuring is what is going to be the foundation.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"setting-up-environment\"><strong>Setting up Environment<\/strong><\/h2>\n\n\n\n<p>The first thing to set up Flask on your system is to install the Python2.7 version or more. Here, I\u2019ll guide you through the process of installing Python on the Windows 10 system.&nbsp;<\/p>\n\n\n\n<p>Using this <a href=\"https:\/\/www.python.org\/downloads\/\">Official Python website<\/a>, you can select the correct python version to install as per your specific OS and system configurations. You can select the latest Python version, as of writing this article the latest is <strong>3.9.10<\/strong>. Please ensure if <strong>pip<\/strong> has been correctly set up after python installation.&nbsp;<\/p>\n\n\n\n<p>The command to check that is `<strong>pip -V<\/strong>`<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/3f2LaNi_K1-y4IDPNsmB3HJ8MlBzv52X5362bhRVAlLuA02Sd_GssAQR48RZuJa2cKdDHI8-b9cI6BGW4ukf8ULFklQiXVACT43NxhPfeWOUHRG2jTMX8SleZjLn1fxkEffU2uc\" alt=\"\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"setting-up-your-virtual-environment\">Setting up your virtual environment<\/h2>\n\n\n\n<p>Using a virtual environment for a python-based project is considered a best programming practice. In the case of Linux OS, it ensures the OS level python is not disturbed by installing and using other python packages. And, in the case of other OS, this ensures the settings and files are intact in the virtual environment which is incredibly useful when different projects need different versions of the same packages.&nbsp;<\/p>\n\n\n\n<p>`<strong>virtualenv<\/strong>` was the tool of choice for creating virtual environments in Python2. But, `<strong>venv<\/strong>` is the tool for Python3 and beyond. `<strong>virtualenv`<\/strong> is a third-party package whereas `<strong>venv<\/strong>` is a default functionality of Python3.x. <strong>&nbsp;<\/strong>We\u2019ll be creating a virtual environment using <strong>venv<\/strong> here.&nbsp;<\/p>\n\n\n\n<p>To work with `<strong>venv<\/strong>` you would just need to ensure you have Python 3.x version installed; x being any version upward of 1.&nbsp;<\/p>\n\n\n\n<p>To create a virtual environment, use the following command,&nbsp;<\/p>\n\n\n\n<p>`python -m venv .`<\/p>\n\n\n\n<p>If you have python 2.x versions also installed in your system then, considering using `python3` instead of python. In my case, Python 3.9.5 is the default version of python installed, so not an issue.&nbsp;<\/p>\n\n\n\n<p>Since I have already navigated inside the folder where I want to create my virtual environment, I have used `.` to point to the directory. You can choose to write the full path where you want your virtual environment created as well.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/uZIjOkHwczFGEW3A6bnMaOVcd6EWaUv8g9eY9nIqYlLiXir-0J_Y1Kw3vNc1oNU-VADjHxep4-a3lTjYsyrzHHUcLgrrH9HU72ZDIzUrYA0EMFobgHDNx4h2zEO2-T740qk7nh4\" alt=\"\"\/><\/figure>\n\n\n\n<p>Once completed, the cursor will return, it will not show any output. To verify if the necessary files and folders have been created, you can use the following command:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/ycyEZgKg_7iWGumI_KlmKRPL8MjvmvvV42lCqO7DvNtyHOZ539dGKfKY8iFANq47yLLZueBIue0Y9hqi_EcHiQdl9jS6RL5ukcs88xMHWmywGyaXr4OwD1ddWHBFJgix2BHxTiA\" alt=\"\"\/><\/figure>\n\n\n\n<p>Now, to activate your virtual environment in Windows OS:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Navigate to the \u2018Scripts\u2019 folder in the virtual environment directory using,<\/li><\/ul>\n\n\n\n<p>`cd Scripts`&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>And, then use the following command:<\/li><\/ul>\n\n\n\n<p>`activate`<\/p>\n\n\n\n<p>This is how an activated virtual environment looks like, irrespective of the OS.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/kZYkP8S6Z40HV26skouWZs0h0PmpTmaQv8QlTZ2GKHJgQ54BXp-WUowweAbzIE7Y7q3YHSN5TNIbceNkjd-IOidEp0jDIjtEBmYH3pv6cJc2ECivbkojcZDhua4LVBoeyFO4yDo\" alt=\"\"\/><\/figure>\n\n\n\n<p>In the case of Mac OS or Linux OS,&nbsp;<\/p>\n\n\n\n<p>`source env_name\/bin\/activate`<\/p>\n\n\n\n<p>And, to deactivate, in any OS.&nbsp;<\/p>\n\n\n\n<p>`deactivate`<\/p>\n\n\n\n<p>Now, let\u2019s install Flask:<\/p>\n\n\n\n<p>`pip3 install Flask`<\/p>\n\n\n\n<p>The output will be something like<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/IIafSvMwkLvpNrCVAsPIZKvcf1NtF86K4Pdzen6-xK1LXzfWRWt-DB0mfXBP4y1L1U61IOa_eiZCECC7qMuic3zudTpszNVlJh17gyvRJLINfS5dK20viWrFWHCLmNfuN6KYUDs\" alt=\"\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"your-1st-flask-application\"><strong>Your 1st Flask Application<\/strong><\/h2>\n\n\n\n<p>To start with a boilerplate application, let\u2019s use the default as mentioned in the Flask documentation.<\/p>\n\n\n\n<p>I have used <strong>Sublime Text Editor<\/strong> here; you can choose any text editor of your choice.&nbsp;<\/p>\n\n\n\n<p>Create a `<strong>server.py<\/strong>` file in the virtual environment and write the following code:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/6VUtYXu6BMi4isR41TmFs42ZY4mbf11MVPcwKi3oSIX1FX4mK9KsvfOXSDHwohYLpAwDaHVJ4dfwg0B5LTIHZCZx8_we2jjHdBPz_9qqeP3KUIQGSsznISPANkjuN1wcs78Lis0\" alt=\"\"\/><\/figure>\n\n\n\n<p>Save this file and run this through the command prompt, just as you would any other python file.&nbsp;<\/p>\n\n\n\n<p>`<strong>python server.py<\/strong>`&nbsp;<\/p>\n\n\n\n<p><strong>Note: <\/strong>Ensure that you never save this as \u2018Flask\u2019 as it would conflict with the Flask itself.&nbsp;<\/p>\n\n\n\n<p>It will give you the following output:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/Yg8Ku0f8g7TtGh6twJA8S1zJdjckLkNPrY9XMjUvX_7HCFShKbwV6_W31kES-48rmfiwPjEZxEFJ7DiXatYjKc8qtD4ZzJ2DWmOq6YpBE7JeW0eQeNo_7U-Ovj64hCS6Zwat8sk\" alt=\"\"\/><\/figure>\n\n\n\n<p>Open the localhost URL mentioned in the command prompt to show an output like:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/pR1c0LxYNW0St0tQRzfhQ3aSYG--VlVa4_Zn5ydM0JiRRVpM9SSE76J6BHPhb4DKuQbDyKfamaeomsygBFBmsZYrVQeX27WV0egZjt5UXUiXwV5_KJGX2nqiMmPtfU60I3p3kUk\" alt=\"\"\/><\/figure>\n\n\n\n<p>Congratulations, on running your first Flask application! If you had followed through all the steps, there wouldn\u2019t be any errors in running the Flask application.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"lets-understand-the-syntax-of-the-program\"><strong>Let\u2019s understand the syntax of the program<\/strong><\/h2>\n\n\n\n<ol class=\"wp-block-list\"><li>The first line of code `<strong>from flask import Flask<\/strong>` is basically importing Flask package in the file.&nbsp;<\/li><li>We next create an object of the flask class using `<strong>app = flask()<\/strong>`<\/li><li>We send the following argument to the default constructor `<strong>__name__<\/strong>`, this will help Flask look for templates and static files.&nbsp;<\/li><li>Next, we use the route decorator to help define which routes should be navigated to the following function. `<strong>@app.route(\/)<\/strong>`<\/li><li>In this, when we use `<strong>\/<\/strong>` it lets Flask direct all the default traffic to the following function.&nbsp;<\/li><li>We define the function and the action to be performed.&nbsp;<\/li><li>The default content type is HTML, so our string will be wrapped in HTML and displayed in the browser.&nbsp;<\/li><li>In the main function created, `<strong>app.run()<\/strong>` will initiate the server to run on the local development server.&nbsp;<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"debugging\"><strong>Debugging&nbsp;<\/strong><\/h2>\n\n\n\n<p>When developing a Flask application, it is important to consider using the debugging mode for these two reasons:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>It will trace errors if and display it.<\/li><li>Each time a change is made, you would have to restart the app to be able to view the change, in order to avoid that, the app can be started in debugging mode where the changes will reflect instantaneously.&nbsp;<\/li><\/ol>\n\n\n\n<p>To debug the code, you need to add to add the following to your code:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/wuO2FJMUqwgGepcZG9Q1umwcyBp-zC2-pXpn8rDrtyTRI4dSybO-R-uGPwT-56C6E5vk8rPs8Wyx7zyy9QbtHUelUglW1eBhpCjK8r2GESm5tOY9ut5VijxKEtKoi_gIp0K3grY\" alt=\"\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"routes\"><strong>Routes<\/strong><\/h2>\n\n\n\n<p>There are few basic functionalities about routes that should be discussed to construct a basic application. The `<strong>route()<\/strong>` as noted earlier is a Flask decorator:<\/p>\n\n\n\n<p>`app.route(rule, options)`<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Rule<\/strong> is the URL for which the particular function should be called upon<\/li><li><strong>options<\/strong> are the list of parameters which can be sent to the function as input<\/li><\/ul>\n\n\n\n<p>You can also use `<strong>app.add_url_rule()<\/strong>` to bind a function to the URL.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/wAtmzKXwhT28PonCsZNzJfbAu99_DtVdI2mALBfZMUM17qZinHzCJjH05mi-nONTTiSwKtkisBErpTdiJrvUFUkNkSFwgTDHWPr77rKlOFx0tNg76kkw3X5tfjHNCk1tewi6RXk\" alt=\"\"\/><\/figure>\n\n\n\n<p>The result is the same as routing to `<strong>\/<\/strong>` which would refer to the homepage of the application.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/9RixXKRHvDUF4byJKxRldX0OBHJXhbiovBYyrbdJhPf4OD3Lbxr-1tLuERaPLX1ZT1QKUphsLFfLAITfyohFDsEUCdjxP0FZxj4WBlC6tFaUko0-nyYPO1pUOIwT4LDGAkN0IkA\" alt=\"\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"dynamic-routing\"><strong>Dynamic Routing<\/strong><\/h2>\n\n\n\n<p>Using `<strong>app.route()<\/strong>` we can also send arguments to the python function. Here\u2019s the sample code and result.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/cmZdDXLo5H_EbFh3I3qOyvOqaUb7zBq_Ck5zoGKHE00-ezDJ7GEBQw2pUXirqtxn5RjGgnFLcXi5ptfJSiqUj97N8uCto68AyQLQaezZoiuqt9w2SeCDhTjdlPonLamos4x20i0\" alt=\"\"\/><\/figure>\n\n\n\n<p>Result:<img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/wc0IAyZQR-dFItiSomZb2N2Bx8yXE-j6QBz5tyxE21UQnhHLewpqnpmfDteYSavR9S1npG5kC7O8l1jiVEMV-E49mLp4pMhruDDGGey2UUt3MDexAN9oRYPp-H-L8pdt9Oj_I_g\" width=\"624\" height=\"303.0702223777771\"><\/p>\n\n\n\n<p>The default variable passed in the above case was a `<strong>string<\/strong>`. There are few other variable types that Werkzeug implementation supports. The same can be found in the Official Flask Documentation too.\u00a0<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><strong>`int`<\/strong>: accepts positive integers<\/li><li><strong>`float`<\/strong>: accepts positive float values<\/li><li><strong>`path`<\/strong>: like `<strong>string<\/strong>` but also accepts slashes<\/li><li><strong>`uuid`<\/strong>: accepts (universally unique identifier)<strong> <\/strong>UUID strings&nbsp;&nbsp;<\/li><li><strong>`string`<\/strong>: (default) accepts any string without a slash<\/li><\/ol>\n\n\n\n<p>You can create a dynamic Flask URL routing using the `<strong>&lt;&gt;<\/strong>` &amp; `<strong>:<\/strong>` symbols. The variable name should be as part of `<strong>&lt;&gt;<\/strong>` and the type of variable can be mentioned inside the same brackets using a colon (`<strong>:<\/strong>`).&nbsp; For example:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/fu-k1eF94gQMAOksqqU03Ent6gAuMVqij3N7Klr9l-BAZ7uRMcPZCUa-i5zENDjMz_PVsDO6T1eufETAXjyJX11qxgf171KhPAhYX7vjYLSu2Bxk5SmsUy848G_uC8yJyWT7Jww\" alt=\"\"\/><\/figure>\n\n\n\n<p>The result remains the same.&nbsp;<\/p>\n\n\n\n<p>Let\u2019s look at few more examples using `<strong>uuid<\/strong>` &amp; `<strong>path<\/strong>` variable types.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/38nU0Zb_efdvs5bLq0h1Sa_QVNJyp4yiMr_1iRW5B9oweIdbqKaI9vheNcmnBMeJb2ZChSl6XYgLkVF7DTWI3NgrPjK2u4u56q0DHITGr5ADHyweV2GA9cQozDPK4HxtiPokndE\" alt=\"\"\/><\/figure>\n\n\n\n<p>The result for `<strong>uuid<\/strong>` based results is:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/4-eqaTCdT9PR4NTaXlriUp0Uju_Q0iXaMKkPTsG4ZSWzEfLNEwScibBqh1fhgvDoLv-a6KlqcrfX4YMqf-X5i72BxojlvviqSFEly1nzqkkoZlf006AuYVxg-Kn6lbzYPeXmT5A\" alt=\"\"\/><\/figure>\n\n\n\n<p>The result for `<strong>path<\/strong>` based results is:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/M22uf3OanxVu0W0PHvJTVZaBUEUsqk_DVvg_T4fdTIuZokaiZjLnTrsppf9Otq9FWr44SderX7ZMuxkKxPMQA1xrlDZiSuAh5pYNST1-L7UvEebDXKlgBrieA5yWmGaKH6acM2k\" alt=\"\"\/><\/figure>\n\n\n\n<p>Now that we have covered the basics of routing in Flask. There is one more important concept we need to be aware of. The importance of slash (`<strong>\/<\/strong>`) in the dynamic routing. Let\u2019s see with an example.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/cWP30omBjIW7NVpvussvQ55S-S6keYQdorRNF_0pmvmrFnlBzMmO7Di54kaeVBPZp1zRY1P-hLXhvjO7TqGtTu40Dwh9gUxXUDs9ZBGKMghxfZHEFeeMVJIOGepCQ_c5PfHrw4o\" alt=\"\"\/><\/figure>\n\n\n\n<p>In the above piece of code, we see two routes one not ending with a slash(`\/python\/flask`) and one ending with a slash(`\/python\/WSGI\/`). The results of the route ending with a slash are:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/axzBclu-4QXAXMhccjhXqsYN8mG410ly6A0u00ssvZkxBrwxA_NdEJll6nWkx5ULJK9mgX1cojZVIL_9pUnlmoGwlAPwT17asQcloWk7t7SW-sv1q4j2YqhOt44W5HSRZuMIcnI\" alt=\"\"\/><\/figure>\n\n\n\n<p>Flask routing creates a URL with the slash at the end if it is explicitly mentioned in the `<strong>route()<\/strong>`. Otherwise,&nbsp;<\/p>\n\n\n\n<p>It will work correctly in routing the URL without slash:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/h5vLE5EFHBgXRCc2bjj_-WtXAfXa_hMkEJr7aNG9j-d3vDILq9BEKyI-FfvSlua6T2zHHzzPqf8gjgAM3poDgqndv-n1NI0Vkr4bfFXfKUtP7XqNPwO9SnF7D1H9oa0ljzlfdew\" alt=\"\"\/><\/figure>\n\n\n\n<p>But not if the URL entered contains a slash at the end:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/LRbc20zHxLPx9Nzl2zjPjoDzoazn1tsodlnRcqscR8qDNEqLAR4M6kt0EPYhEDg4i3nuARNFyhnPKVijvfu7MrsQlVNmldPI95_tcXxtRszJoIyws9t5glVlFOf7l27omEg_krw\" alt=\"\"\/><\/figure>\n\n\n\n<p>It will result in a <strong>404 Not found error<\/strong>. This is a useful piece of information to keep in mind.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"url-building\">URL Building<\/h2>\n\n\n\n<p>There\u2019s another approach to building URLs dynamically in Flask applications. Let\u2019s look at `url_for()` method. This is basically the building routing approach in reverse order. The easy way of hard-coding routing is what we have seen using `<strong>app.route()<\/strong>` and `<strong>app.add_url_rule()<\/strong>` methods.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"how-does-that-work\">How Does that work?<\/h2>\n\n\n\n<p>Let\u2019s see with an example. Shall we?<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/tRsX5ArJGLtpft4tviutKICxjhpo4RTgCCYkqDR_QyzIykVxUvCV-iEtxuehMIccl3IqJb-TqrNBSYITJmEF-0HUaEXfbAMevJHEBRsPpEGvsG2CJYzDf4DUw3OCgGFF7ULXpfY\" alt=\"\"\/><\/figure>\n\n\n\n<p>The first thing to note is the additional imports. `<strong>redirect<\/strong>` &amp; `<strong>url_for()<\/strong>` need to be imported separately, to begin with.&nbsp;<\/p>\n\n\n\n<p>In the above example, we\u2019ve 3 simple routes and their functions hard-coded in the traditional manner. And, then we have a special function `<strong>display_user()<\/strong>`. This method takes a user-defined input through their URL. Based on the input of the `<strong>country<\/strong>` variable, `<strong>url_for()<\/strong>` method redirects it to the appropriate function call.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/S0gyrRtuxqCMURAC_TyWPX0ucY84-aIx6briJ1jczppbLjODg7sHQB_ZLtqFokQ9Vz03zy0zuXxXJox2eu4y5M2LR4PRCFVRogQewT9sUmwYmiRBlStfpCqn4yKWgYZDSlKv0Sg\" alt=\"\"\/><\/figure>\n\n\n\n<p>Similarly, for Spain.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/NvXifo-PhcqAQSjKJxxhCjn4X_hAIAtvHzGDA-Zw25YG-pjokIHnRTmn-fuK67NxSP1n0C00xB8cr9YCnCHcwUD083rxnTHbZUN9_Z9v7FQKE4aXyVPCD__4GLJ0czFWi8lso2o\" alt=\"\"\/><\/figure>\n\n\n\n<p>Now, in case of Germany, we\u2019re additionally passing `<strong>capital<\/strong> ` variable also to the function.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/j8NRn8djIne5vXNNcrYO1vAIr-RBS7DcHjL5QaCSyw3JIzYz5P1-L9Jr4WkFR3SW_M0JvG9f5ESkHglxK6CzOjSXy6ulCF8M48mpzNEVkkbab5juvTAPeE76FlIz4P2xy1cwzwE\" alt=\"\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"why-should-you-consider-dynamic-url-building\">Why should you consider Dynamic URL Building?<\/h2>\n\n\n\n<ol class=\"wp-block-list\"><li>Reversing of routing is far more descriptive than hard-coding (hard-coding is bad practice) of routes.&nbsp;<\/li><li>This way escape characters &amp; Unicode characters can be handled efficiently.&nbsp;<\/li><li>The generated pathways are absolute, removing the uncertainty of unexpected pathways.&nbsp;<\/li><li>Changes can be made easily now that the paths are built at the same place.&nbsp;<\/li><li>If the app is placed outside of the root, dynamic URL building will handle that as well.&nbsp;<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"http-methods\"><strong>HTTP Methods<\/strong><\/h2>\n\n\n\n<p>HTTP methods are at the core of communication between different parties of the world wide web, one of them being the Flask app you will be designing. These methods are standard across any frameworks, so let\u2019s see how Flask handles them.&nbsp;<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>GET&nbsp;<\/li><\/ol>\n\n\n\n<p>It is the most basic and unencrypted form of sending data to the website by appending the content to the URL. It can be used in cases where data of invaluable nature (which will not be an issue if disclosed) is being shared with the server. It is most commonly used in cases of fetching data or loading a new HTML page.&nbsp;<\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\"><li>POST<\/li><\/ol>\n\n\n\n<p>The POST method is the second most used method after GET. The data is encrypted and sent to the server. It is not appended to the URL, it is sent in the body of HTML, most commonly as part of HTML form data. It is also not cached on the system. This is one of the most trusted methods to send sensitive data to the server like login credentials, etc.&nbsp;<\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"3\"><li>HEAD<\/li><\/ol>\n\n\n\n<p>The HEAD method is very similar to the Get method. This is can be cached on the end-user\u2019s system, is unencrypted but it is not supposed to have a response body. For example, a URL request can have a large download attached to it, but, using HEAD method, the URL can request to check the `content-length` from the header alone to get the file size without downloading the entire file.&nbsp;<\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"4\"><li>PUT<\/li><\/ol>\n\n\n\n<p>The PUT method is similar to the POST method, except for the fact, calling a POST method multiple times will send that many requests to the server as opposed to the PUT method, wherein it will just replace the current result or response with the same response.<\/p>\n\n\n\n<p>In a nutshell, PUT is used to create a resource most often, so that subsequent requests do not create jredundant resources (and end-user receives a `201 created error`) whereas, POST should be used when updating resources, there can be multiple update requests.&nbsp;<\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"5\"><li>DELETE<\/li><\/ol>\n\n\n\n<p>The DELETE sends a request to erase the particular resource to the server.&nbsp;<\/p>\n\n\n\n<p>You can add any of the methods to the route by adding an argument to the `<strong>app.route()<\/strong>` method. For example:<\/p>\n\n\n\n<p><strong>Note:<\/strong> Create a folder in your project folder by the name of `<strong>Templates<\/strong>`. Create a `<strong>login.html<\/strong>` file inside this folder structure.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/u9BCXDnb5NYQwRv21fvyS2CCqPKKhFCMVOFcfgE5vxV5plP-HMiG-eaWgWJI5YM_H6b5gYY75Rda0nPqPAdTYo8p6lQeh3b8zaym7L2ZYHFSlUh9AhHU_F4Pc6UTvY0Ju4k6jHc\" alt=\"\"\/><\/figure>\n\n\n\n<p>In the `<strong>login.html<\/strong>` file, we\u2019ve created a basic HTML form of <strong>POST<\/strong> HTTP method type and with one textbox to take user input and one Submit button.&nbsp;<\/p>\n\n\n\n<p>Then, in your `<strong>server.py<\/strong>` file make the following changes:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/Xk5mSPZYlqEHFhzMnOk8tSDmEiPbr_1qcUyRox1SN1a-CWlyS_313euQqNvbdoOFgeIof0s9IPpcqjn39NLXGtLjyRpEPCjEatQBYsR-qM0t3HoBncRIghH_gj20bGgC7e08JfA\" alt=\"\"\/><\/figure>\n\n\n\n<p>In the `<strong>server.py<\/strong>` file, we notice that we need an additional Flask functionality to be imported, namely, `<strong>render_template<\/strong>`. We\u2019ll venture in deep regarding that functionality later. Then, we create a routing URL for `<strong>login<\/strong>`. In the `<strong>@app.route(\u2018\/login\u2019, methods = [\u2018POST\u2019, \u2018GET\u2019])<\/strong>` we\u2019ve added the `<strong>methods<\/strong>` argument which contains the list of HTTP methods which will be allowed.&nbsp;<\/p>\n\n\n\n<p>In that function, if the HTTP request type is GET, we use `<strong>render_template()<\/strong>` functionality to call upon the static HTML page of `<strong>login.html<\/strong>`. And, if the request type is POST, we extract the `<strong>nm<\/strong>` parameter from the HTML Form and `<strong>redirect<\/strong>` the data to `<strong>success<\/strong>` URL.&nbsp;<\/p>\n\n\n\n<p>This is one simple example using <strong>GET<\/strong> and <strong>POST<\/strong> HTTP method requests. Similarly, any of the HTTP methods can be incorporated based on the need using <strong>method<\/strong> argument in `<strong>@app.route()<\/strong>` decorator.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"templates-in-flask\"><strong>Templates in Flask<\/strong><\/h2>\n\n\n\n<p>Now that we\u2019ve seen a working example of loading static HTML pages in a flask application, let\u2019s explore Templates more.&nbsp;<\/p>\n\n\n\n<p>\u2018<strong>Web Templating system<\/strong>\u2019 refers to displaying an HTML page to the end-user. This revolves around 3 parts:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>A Core template engine: In this case it is Jinja2<\/li><li>Data source: It can be any content hard-coded in HTML or passed to the HTML file<\/li><li>Template processor: In this, python expressions will help in processing the templates.&nbsp;<\/li><\/ol>\n\n\n\n<p>In a simple Flask application, we can hard-code our HTML page from the main python script file. For example:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/uTjf0WTNIS20QA3KbNt0kU18DT1wmyS0cuFLur-5BCtQLP-u_OdP6vnc_XFEifWNNuQhRg7zaG7JxcywqiXPwGJdIZdqNb5SbYrRHB6G5HxHBQJwsRUYmtiMuZN-Dxx0IncBH5c\" alt=\"\"\/><\/figure>\n\n\n\n<p>In the above example, let\u2019s replace the content of `<strong>success()<\/strong>` function. This gives us the same output as previously.&nbsp;<\/p>\n\n\n\n<p>While this one way of approaching HTML content, most often, this wouldn\u2019t be the optimal way for any project other than a Hello World program. Real-life projects will have more complexity.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"project-folder-structure\">Project Folder Structure<\/h2>\n\n\n\n<p>Before continuing further, let\u2019s look at the Project Folder structure. It is important we know this before continuing ahead.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/ylPAmAijJwFpNZYgnSlVyuWws-rIvakOtOEqbtecjKl7NR-PMHH8Z2ombbtEbwBh6ELlsvFa7mB4TsUlxmB__jief_6dPuAPa3rsiIRUCxTkV2MlK3Gpfj8fzp77ivjhU_nQUPo\" alt=\"\"\/><\/figure>\n\n\n\n<p>This is the Flask application project folder. You\u2019ll have to create a folder by the name of <strong>Templates<\/strong> in which you can save all your HTML files. This path structuring is necessary to enable Jinja2 template engine to identify and process the HTML file.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"static-files\">Static Files<\/h2>\n\n\n\n<p>Similar to the HTML files, all the necessary static files such as images, videos, CSS files, JS files, etc need to be placed under the folder name of <strong>static<\/strong>. This needs to be created in the root folder same as <strong>Templates<\/strong>.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"jinja-2\">Jinja 2<\/h2>\n\n\n\n<p>Jinja2 being the web templating system has few templates which would allow us to create Python expressions in the HTML file.&nbsp;<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>{{ \u2026.. }} : This will process the Python code written and display accordingly. Example seen earlier.<\/li><li>{ %\u2026..% } : For statements.<\/li><li>{# \u2026. #} : For comments not to be included in the template output.&nbsp;<\/li><\/ol>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"rendering-templates\">Rendering Templates<\/h2>\n\n\n\n<p>`<strong>render_template()<\/strong>` is the Flask function which helps render the HTML file provided to it.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/uTjf0WTNIS20QA3KbNt0kU18DT1wmyS0cuFLur-5BCtQLP-u_OdP6vnc_XFEifWNNuQhRg7zaG7JxcywqiXPwGJdIZdqNb5SbYrRHB6G5HxHBQJwsRUYmtiMuZN-Dxx0IncBH5c\" alt=\"\"\/><\/figure>\n\n\n\n<p>Referring to the above example, we see the most basic implementation of the function. Only the HTML page\u2019s name is passed as argument.&nbsp;<\/p>\n\n\n\n<p>In the templates, you can also access the `<strong>request<\/strong>`, `<strong>sessions<\/strong>`, `<strong>get_flashed_message<\/strong>` and `<strong>g<\/strong>` objects also. Each of these can be further looked up in Flask official Documentation. And, templates especially useful when <strong>Template Inheritance<\/strong> is used.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"request-object\"><strong>Request object<\/strong><\/h2>\n\n\n\n<p>The communication from end-user to server running Flask happens through the usage of Flask\u2019s global <strong>Request<\/strong> object. This has to be specifically imported from Flask module. <strong>Request<\/strong> objects important attributes are:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><strong>method<\/strong>:- It defines the HTTP method request object type.&nbsp;<\/li><li><strong>Form<\/strong>:- It contains a dictionary object of all the Form attributes and its values.&nbsp;<\/li><li><strong>args<\/strong>:- contents sent as part of query string in the URL after a (?) mark.<\/li><li><strong>files<\/strong>:- data in which was uploaded to the application.<\/li><\/ol>\n\n\n\n<p>Of these, we\u2019ve already seen the <strong>Form<\/strong> attribute.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/7uLgOm4qvJG1CMz1E51xvS6gVikUm2zu-wQvb67hGX5DW5nH-quKD8PKPz1e4F_wt1_fbvTOBZae4RPfFcQeXs3oZBa0fZcK8LoHatY-zv1genzD-rd2cJQ_8ujr9I2j2RCBNlQ\" alt=\"\"\/><\/figure>\n\n\n\n<p>In this earlier example, when we used `<strong>request.form[\u2018nm\u2019]<\/strong>` - it requested for a particular value for the key \u2018nm\u2019 from the Form dictionary. There are multiple other ways to get data from the Request object. Let\u2019s see the example of <strong>args<\/strong> attribute.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/OSmtnSo7mEh5WCf62kK8lPwj7J77yu1m6dUEnG8B1xML3D4x3eyI7i45aBZCvVTO6wOU7XhHHomIsw-UAp10pIEZ3j4fC78AC3MARpNtO6R44d4cJBWS74PjjEZceBnp6oqDyCE\" alt=\"\"\/><\/figure>\n\n\n\n<p>This is the same sample re-worked to change the execution when <strong>GET<\/strong> HTTP method is called. Earlier, we were directly calling the `<strong>login.html<\/strong>` using `<strong>render_template()<\/strong>`. Now, we\u2019re taking an input of username from the <strong>args<\/strong> attribute of <strong>Request<\/strong> object.&nbsp;<\/p>\n\n\n\n<p>When running the application, call the URL : `<strong>http:\/\/127.0.01:5000\/login?nm=Administrator<\/strong>`. You\u2019ll notice, it redirects you to show the following page:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/Xrj4NFIiGhrQKLp80IHzEg4b_g_h6fXhwFAjhrAopP9_Uc1MJ4_DzDFmKjHuZHc8Tan1IAKreHqEH4wTqSKig4lGYmM8m1kh1f1JVVU54p4Sk0WKmGTLNkhQUrmaXS3rGcnfiW4\" alt=\"\"\/><\/figure>\n\n\n\n<p>By appending the value for \u2018nm\u2019 in the query string after a (?), the Flask application wraps it as part of <strong>args<\/strong> attribute of <strong>Request<\/strong> object and sends it to the python function linked to it.&nbsp;<\/p>\n\n\n\n<p>Other than <strong>Form<\/strong> and <strong>args<\/strong> attribute, we\u2019ve also seen the <strong>method<\/strong> attribute, of how the HTTP method can be chosen and to received using <strong>method<\/strong> argument in `<strong>app.route()<\/strong>` decorator.&nbsp;<\/p>\n\n\n\n<p>The only attribute new to us, is <strong>files<\/strong>. It is used in case when end-user needs to upload a file to the server via application.&nbsp;<\/p>\n\n\n\n<p>Let\u2019s explore that with an example.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/cQO2V5XKVsozxAhgS3USx4UJJ2Fs8gdcPgb9PUJlMc9ubmUCzdyjZhEIaX1R-GvC22puKLKjspgRZKYiL73MAT2MyTtxfapVzwCPmdwXJ1qPKA1q82w9S6Lc5S-_slxEmr1dLZU\" alt=\"\"\/><\/figure>\n\n\n\n<p>In the above code, first we note `<strong>Werkzeug.utils<\/strong>` as an additional package we use to import `<strong>secure_filename<\/strong>`. This file is necessary in case you would like to save the file using `<strong>secure_filename<\/strong>` function, which is the best practice to retain the file name of the uploaded document as provided by the end-user. You can also do it without using that function, but as the function name suggests, it is not secure otherwise.&nbsp;<\/p>\n\n\n\n<p>Next, we note that we\u2019ve created two URLs one, to render the <strong>upload.html<\/strong> and other to retrieve the file using <strong>Request<\/strong> object and saving it in the server.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/PKOMFljHgnh0oNHoqG62-P5A4sLSiNqDvSbeSx8PlA6lJN4whD4vsYJ7X8SS_vrKXRRXqW5Zrw5foE7vlU0VhCzjAStp8AwAECX3Bs-cysnOPu2UWJ_5BfjZ_-qSt0La9E4IBqI\" alt=\"\"\/><\/figure>\n\n\n\n<p>The above shown is the <strong>upload.html<\/strong> HTML file. The attribute `<strong>enctype = multipart\/form-data<\/strong>` in form tag is extremely important, failing which the file will not get uploaded to the application server.&nbsp;&nbsp;&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/9uI4T4VhD3sBqYd1iKlmLHh5YaEUkqS-DXh97vg_19P5Y40dpv20uL5d0MnBxFojpexfPSg4LFZORGRoVDJqlV3MmMKes-xGklAiskw7QFN7ewCelBrGWrWs1nCaQpvRApAHD-I\" alt=\"\"\/><\/figure>\n\n\n\n<p>The above is the output of the first URL <strong>upload<\/strong>. And below is the output after selecting the file and clicking on the Submit button.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/9qbf0ugWXNXEZTGjbpgD5sCne8nyW29Gfe43tXiV3fkfT3HjLTUAZPbfNMtFaj_2YiTK-_OmsuYYBQ33pL79UTkDUYQb7AMZ91ggiLs0nNRSZKQ36iv40O5nT9FE3eS23TzrKWc\" alt=\"\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"response-object\"><strong>Response Object<\/strong><\/h2>\n\n\n\n<p>Using <strong>Request<\/strong> object, we saw how to interpret the data sent from end-user to the application server. And, <strong>Response<\/strong> object does the opposite of that, it helps package and send data from application to the end-user. Flask is the most preferred language for creating API\u2019s. And, this is the most important part of it.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/DeYq8zYFib_HJ9jT8w-Wz89wMmjm4TpYDpRoaBK0xZ5Aa4aEFkg8LtqvYCLuNfGo4W2rKlf0rL9y9yMbGVDa4Rv37Jd9wmFzSVzlxyoLOiKBDWqbnRx3LkQRfjfx247z3IZN26g\" alt=\"\"\/><\/figure>\n\n\n\n<p>As seen above, we have first imported `<strong>jsonify<\/strong>` &amp; `<strong>make_response<\/strong>` global objects from Flask. We, the create a URL function `<strong>check()<\/strong>` with id argument which can have a default of <em>None<\/em> type. Inside this function, we check for <strong>id<\/strong> argument:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>If <strong>id<\/strong> has not been provided, we use `<strong>jsonify()<\/strong>` method to create a dictionary with a message which we send back with <strong>statuscode<\/strong> 400 wrapped in a `<strong>make_response()<\/strong>` object.&nbsp;<\/li><li>If <strong>id<\/strong> is provided, we just send back a dictionary with two sets of key-value pair.&nbsp;<\/li><\/ol>\n\n\n\n<p>The below is output for (i).<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/Kw5kNe5NsI0Nq-kcwPjTyvWUZaLMIua8wh4MdP4rzw25Uynl6cJQq3RZpBxlpnArSDPj6qiVQjnpDVpeM-M8WLGQRWj9_42pzQ-NxEslcXiwrU3ve1WI4E72Ff_cNQ-rEkzTp9s\" alt=\"\"\/><\/figure>\n\n\n\n<p>The below is output for (iI).<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/4bLA0GpB4f5Oe9EFVAeyKnihAEpAlECnUK0b3sveWnBmBHvs0iGkA5a5HGkFlEnJVb3FpujNf0eP1MJpWU6l4P7JmfLxNWFsq2s1T2mWM0jZo6I_Ee6ACKli99uoM9FVJtvq-oA\" alt=\"\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"conclusion\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p>The above was a basic overview of Flask for beginners. There's a lot more to still explore, but, using this you will be able to kickstart your very own Flask application in no time.&nbsp;Also, check out the <a href=\"https:\/\/www.mygreatlearning.com\/academy\" target=\"_blank\" rel=\"noreferrer noopener\">Great Learning Academy<\/a> which offers 200+ free courses. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Python is the most sort after language for web application development and data science as well. It has risen to this height for its ease of use and variety of supportive libraries. There are legacy frameworks like Java\u2019s Enterprise edition and ASP. NET\u2019s MVC framework is still popular for enterprise-level development. But Python is [&hellip;]<\/p>\n","protected":false},"author":41,"featured_media":39644,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[25860],"tags":[36796],"content_type":[],"class_list":["post-40230","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","tag-python"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Everything you need to know about Flask for beginners.<\/title>\n<meta name=\"description\" content=\"In Python, the leaders are Django and Flask. Django is very much similar to the MVC framework of ASP .NET. But Flask is different. Let\u2019s see how.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.mygreatlearning.com\/blog\/everything-you-need-to-know-about-flask-for-beginners\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Everything you need to know about Flask for beginners.\" \/>\n<meta property=\"og:description\" content=\"In Python, the leaders are Django and Flask. Django is very much similar to the MVC framework of ASP .NET. But Flask is different. Let\u2019s see how.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mygreatlearning.com\/blog\/everything-you-need-to-know-about-flask-for-beginners\/\" \/>\n<meta property=\"og:site_name\" content=\"Great Learning Blog: Free Resources what Matters to shape your Career!\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/GreatLearningOfficial\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-21T07:16:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-14T18:26:23+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/07\/iStock-1177967778-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1254\" \/>\n\t<meta property=\"og:image:height\" content=\"837\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Great Learning Editorial Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/Great_Learning\" \/>\n<meta name=\"twitter:site\" content=\"@Great_Learning\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Great Learning Editorial Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"24 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/everything-you-need-to-know-about-flask-for-beginners\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/everything-you-need-to-know-about-flask-for-beginners\\\/\"},\"author\":{\"name\":\"Great Learning Editorial Team\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\"},\"headline\":\"Everything you need to know about Flask for beginners.\",\"datePublished\":\"2021-07-21T07:16:15+00:00\",\"dateModified\":\"2024-10-14T18:26:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/everything-you-need-to-know-about-flask-for-beginners\\\/\"},\"wordCount\":3681,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/everything-you-need-to-know-about-flask-for-beginners\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/iStock-1177967778-1.jpg\",\"keywords\":[\"python\"],\"articleSection\":[\"IT\\\/Software Development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/everything-you-need-to-know-about-flask-for-beginners\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/everything-you-need-to-know-about-flask-for-beginners\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/everything-you-need-to-know-about-flask-for-beginners\\\/\",\"name\":\"Everything you need to know about Flask for beginners.\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/everything-you-need-to-know-about-flask-for-beginners\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/everything-you-need-to-know-about-flask-for-beginners\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/iStock-1177967778-1.jpg\",\"datePublished\":\"2021-07-21T07:16:15+00:00\",\"dateModified\":\"2024-10-14T18:26:23+00:00\",\"description\":\"In Python, the leaders are Django and Flask. Django is very much similar to the MVC framework of ASP .NET. But Flask is different. Let\u2019s see how.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/everything-you-need-to-know-about-flask-for-beginners\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/everything-you-need-to-know-about-flask-for-beginners\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/everything-you-need-to-know-about-flask-for-beginners\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/iStock-1177967778-1.jpg\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/iStock-1177967778-1.jpg\",\"width\":1254,\"height\":837,\"caption\":\"Bookshelves and laptops are placed on the library desk.E-learning class and e-book digital technology\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/everything-you-need-to-know-about-flask-for-beginners\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"IT\\\/Software Development\",\"item\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/software\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Everything you need to know about Flask for beginners.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\",\"name\":\"Great Learning Blog\",\"description\":\"Learn, Upskill &amp; Career Development Guide and Resources\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"alternateName\":\"Great Learning\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\",\"name\":\"Great Learning\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/GL-Logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/GL-Logo.jpg\",\"width\":900,\"height\":900,\"caption\":\"Great Learning\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/GreatLearningOfficial\\\/\",\"https:\\\/\\\/x.com\\\/Great_Learning\",\"https:\\\/\\\/www.instagram.com\\\/greatlearningofficial\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/school\\\/great-learning\\\/\",\"https:\\\/\\\/in.pinterest.com\\\/greatlearning12\\\/\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/beaconelearning\\\/\"],\"description\":\"Great Learning is a leading global ed-tech company for professional training and higher education. It offers comprehensive, industry-relevant, hands-on learning programs across various business, technology, and interdisciplinary domains driving the digital economy. These programs are developed and offered in collaboration with the world's foremost academic institutions.\",\"email\":\"info@mygreatlearning.com\",\"legalName\":\"Great Learning Education Services Pvt. Ltd\",\"foundingDate\":\"2013-11-29\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"1001\",\"maxValue\":\"5000\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\",\"name\":\"Great Learning Editorial Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"caption\":\"Great Learning Editorial Team\"},\"description\":\"The Great Learning Editorial Staff includes a dynamic team of subject matter experts, instructors, and education professionals who combine their deep industry knowledge with innovative teaching methods. Their mission is to provide learners with the skills and insights needed to excel in their careers, whether through upskilling, reskilling, or transitioning into new fields.\",\"sameAs\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/\",\"https:\\\/\\\/in.linkedin.com\\\/school\\\/great-learning\\\/\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/Great_Learning\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCObs0kLIrDjX2LLSybqNaEA\"],\"award\":[\"Best EdTech Company of the Year 2024\",\"Education Economictimes Outstanding Education\\\/Edtech Solution Provider of the Year 2024\",\"Leading E-learning Platform 2024\"],\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/author\\\/greatlearning\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Everything you need to know about Flask for beginners.","description":"In Python, the leaders are Django and Flask. Django is very much similar to the MVC framework of ASP .NET. But Flask is different. Let\u2019s see how.","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:\/\/www.mygreatlearning.com\/blog\/everything-you-need-to-know-about-flask-for-beginners\/","og_locale":"en_US","og_type":"article","og_title":"Everything you need to know about Flask for beginners.","og_description":"In Python, the leaders are Django and Flask. Django is very much similar to the MVC framework of ASP .NET. But Flask is different. Let\u2019s see how.","og_url":"https:\/\/www.mygreatlearning.com\/blog\/everything-you-need-to-know-about-flask-for-beginners\/","og_site_name":"Great Learning Blog: Free Resources what Matters to shape your Career!","article_publisher":"https:\/\/www.facebook.com\/GreatLearningOfficial\/","article_published_time":"2021-07-21T07:16:15+00:00","article_modified_time":"2024-10-14T18:26:23+00:00","og_image":[{"width":1254,"height":837,"url":"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/07\/iStock-1177967778-1.jpg","type":"image\/jpeg"}],"author":"Great Learning Editorial Team","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/Great_Learning","twitter_site":"@Great_Learning","twitter_misc":{"Written by":"Great Learning Editorial Team","Est. reading time":"24 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.mygreatlearning.com\/blog\/everything-you-need-to-know-about-flask-for-beginners\/#article","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/everything-you-need-to-know-about-flask-for-beginners\/"},"author":{"name":"Great Learning Editorial Team","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad"},"headline":"Everything you need to know about Flask for beginners.","datePublished":"2021-07-21T07:16:15+00:00","dateModified":"2024-10-14T18:26:23+00:00","mainEntityOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/everything-you-need-to-know-about-flask-for-beginners\/"},"wordCount":3681,"commentCount":0,"publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/everything-you-need-to-know-about-flask-for-beginners\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/07\/iStock-1177967778-1.jpg","keywords":["python"],"articleSection":["IT\/Software Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.mygreatlearning.com\/blog\/everything-you-need-to-know-about-flask-for-beginners\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.mygreatlearning.com\/blog\/everything-you-need-to-know-about-flask-for-beginners\/","url":"https:\/\/www.mygreatlearning.com\/blog\/everything-you-need-to-know-about-flask-for-beginners\/","name":"Everything you need to know about Flask for beginners.","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/everything-you-need-to-know-about-flask-for-beginners\/#primaryimage"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/everything-you-need-to-know-about-flask-for-beginners\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/07\/iStock-1177967778-1.jpg","datePublished":"2021-07-21T07:16:15+00:00","dateModified":"2024-10-14T18:26:23+00:00","description":"In Python, the leaders are Django and Flask. Django is very much similar to the MVC framework of ASP .NET. But Flask is different. Let\u2019s see how.","breadcrumb":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/everything-you-need-to-know-about-flask-for-beginners\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mygreatlearning.com\/blog\/everything-you-need-to-know-about-flask-for-beginners\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/everything-you-need-to-know-about-flask-for-beginners\/#primaryimage","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/07\/iStock-1177967778-1.jpg","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/07\/iStock-1177967778-1.jpg","width":1254,"height":837,"caption":"Bookshelves and laptops are placed on the library desk.E-learning class and e-book digital technology"},{"@type":"BreadcrumbList","@id":"https:\/\/www.mygreatlearning.com\/blog\/everything-you-need-to-know-about-flask-for-beginners\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/www.mygreatlearning.com\/blog\/"},{"@type":"ListItem","position":2,"name":"IT\/Software Development","item":"https:\/\/www.mygreatlearning.com\/blog\/software\/"},{"@type":"ListItem","position":3,"name":"Everything you need to know about Flask for beginners."}]},{"@type":"WebSite","@id":"https:\/\/www.mygreatlearning.com\/blog\/#website","url":"https:\/\/www.mygreatlearning.com\/blog\/","name":"Great Learning Blog","description":"Learn, Upskill &amp; Career Development Guide and Resources","publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"alternateName":"Great Learning","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.mygreatlearning.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization","name":"Great Learning","url":"https:\/\/www.mygreatlearning.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg","width":900,"height":900,"caption":"Great Learning"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/GreatLearningOfficial\/","https:\/\/x.com\/Great_Learning","https:\/\/www.instagram.com\/greatlearningofficial\/","https:\/\/www.linkedin.com\/school\/great-learning\/","https:\/\/in.pinterest.com\/greatlearning12\/","https:\/\/www.youtube.com\/user\/beaconelearning\/"],"description":"Great Learning is a leading global ed-tech company for professional training and higher education. It offers comprehensive, industry-relevant, hands-on learning programs across various business, technology, and interdisciplinary domains driving the digital economy. These programs are developed and offered in collaboration with the world's foremost academic institutions.","email":"info@mygreatlearning.com","legalName":"Great Learning Education Services Pvt. Ltd","foundingDate":"2013-11-29","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"1001","maxValue":"5000"}},{"@type":"Person","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad","name":"Great Learning Editorial Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","caption":"Great Learning Editorial Team"},"description":"The Great Learning Editorial Staff includes a dynamic team of subject matter experts, instructors, and education professionals who combine their deep industry knowledge with innovative teaching methods. Their mission is to provide learners with the skills and insights needed to excel in their careers, whether through upskilling, reskilling, or transitioning into new fields.","sameAs":["https:\/\/www.mygreatlearning.com\/","https:\/\/in.linkedin.com\/school\/great-learning\/","https:\/\/x.com\/https:\/\/twitter.com\/Great_Learning","https:\/\/www.youtube.com\/channel\/UCObs0kLIrDjX2LLSybqNaEA"],"award":["Best EdTech Company of the Year 2024","Education Economictimes Outstanding Education\/Edtech Solution Provider of the Year 2024","Leading E-learning Platform 2024"],"url":"https:\/\/www.mygreatlearning.com\/blog\/author\/greatlearning\/"}]}},"uagb_featured_image_src":{"full":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/07\/iStock-1177967778-1.jpg",1254,837,false],"thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/07\/iStock-1177967778-1-150x150.jpg",150,150,true],"medium":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/07\/iStock-1177967778-1-300x200.jpg",300,200,true],"medium_large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/07\/iStock-1177967778-1-768x513.jpg",768,513,true],"large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/07\/iStock-1177967778-1-1024x683.jpg",1024,683,true],"1536x1536":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/07\/iStock-1177967778-1.jpg",1254,837,false],"2048x2048":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/07\/iStock-1177967778-1.jpg",1254,837,false],"web-stories-poster-portrait":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/07\/iStock-1177967778-1-640x837.jpg",640,837,true],"web-stories-publisher-logo":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/07\/iStock-1177967778-1-96x96.jpg",96,96,true],"web-stories-thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/07\/iStock-1177967778-1-150x100.jpg",150,100,true]},"uagb_author_info":{"display_name":"Great Learning Editorial Team","author_link":"https:\/\/www.mygreatlearning.com\/blog\/author\/greatlearning\/"},"uagb_comment_info":2,"uagb_excerpt":"Introduction Python is the most sort after language for web application development and data science as well. It has risen to this height for its ease of use and variety of supportive libraries. There are legacy frameworks like Java\u2019s Enterprise edition and ASP. NET\u2019s MVC framework is still popular for enterprise-level development. But Python is&hellip;","_links":{"self":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/40230","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/comments?post=40230"}],"version-history":[{"count":6,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/40230\/revisions"}],"predecessor-version":[{"id":84275,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/40230\/revisions\/84275"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media\/39644"}],"wp:attachment":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media?parent=40230"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/categories?post=40230"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/tags?post=40230"},{"taxonomy":"content_type","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/content_type?post=40230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}