{"id":8413,"date":"2020-09-10T18:05:46","date_gmt":"2020-09-10T18:05:46","guid":{"rendered":"https:\/\/www.askpython.com\/?p=8413"},"modified":"2020-09-10T18:05:48","modified_gmt":"2020-09-10T18:05:48","slug":"flask-vs-django","status":"publish","type":"post","link":"https:\/\/www.askpython.com\/python-modules\/flask-vs-django","title":{"rendered":"Flask Vs. Django  &#8211; Quick comparison between Django and Flask"},"content":{"rendered":"\n<p>Holla guys!! In this article, we will encounter some of the primary differences between Flask and Django. So let\u2019s get started!!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is <strong>Django<\/strong>?<\/h2>\n\n\n\n<p>Django is an <strong>extensive<\/strong> web framework built with the idea of making the web development process simpler. It is an open-source python web development framework based on the <a href=\"https:\/\/www.askpython.com\/django\/django-mvt-architecture\" class=\"rank-math-link\">MVT-Model View Template <\/a>architecture.<\/p>\n\n\n\n<p>It focuses on reusable components, fewer codes, and rapid development. Also, Django has its <strong>ORM<\/strong> (Object-relational Mapping) system. <\/p>\n\n\n\n<p>That is, it works with <a href=\"https:\/\/www.askpython.com\/django\/django-models\" class=\"rank-math-link\"><strong>models<\/strong><\/a> (with a structure similar to the database tables) and is used to link DB tables with the rest of the application codes. <\/p>\n\n\n\n<p>Django Applications have a Directory structure and is most suitable for Large-scaled web projects(like E-Commerce, Social Media, etc.)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is <strong>Flask<\/strong>?<\/h2>\n\n\n\n<p><a href=\"https:\/\/www.askpython.com\/python-modules\/flask\/create-hello-world-in-flask\" class=\"rank-math-link\">Flask<\/a> is a micro web framework built on the python programming language and has minimal web development tools. Hence, it gives more scope for customizability, which means that it has minimalistic built-in packages and has no restrictions. The developers are free to use any third-party library they want.<\/p>\n\n\n\n<p>Flask does<strong> not <\/strong>provide its <strong>ORM<\/strong> and hence doesn\u2019t have models at all, unlike Django. <\/p>\n\n\n\n<p>Flask applications are usually single-page applications(SPA) are used generally for small\/medium scale web projects like(Blogs, etc.)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Comparing the Differences Between Flask and Django<\/strong><\/h2>\n\n\n\n<p>The Basic differences are:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Django <\/th><th>Flask<\/th><\/tr><\/thead><tbody><tr><td><strong>Extensive web framework<\/strong>: It is full-featured built on Python and has MVT architecture. It has excellent documentation.<\/td><td><strong>Micro web framework:<\/strong> It has minimalistic built-in packages also built on Python. Light, simple and customizable framework. It is Beginner-Friendly.<\/td><\/tr><tr><td><strong>Provides ORM system:<\/strong> It has its ORM system pre-built. Hence makes working with databases simpler<\/td><td><strong>No ORM system:<\/strong> It does not have an ORM system pre-built and does not have models at all. It has other means to work with databases.<\/td><\/tr><tr><td><strong>Directory-Based<\/strong> <strong>structure<\/strong>: It has a proper Directory-based design with all the models, views, URLs, and templates, etc. stored separately in separate files.<\/td><td><strong>More Modular Structure:<\/strong> It is used to build single-page applications(SPAs) and has modular structure. Hence all Views, URLs etc can be stored in the same file.<\/td><\/tr><tr><td><strong>More significant Community:<\/strong> It is well-established in the market from way earlier than Flask. Hence has larger community support than Flask.<\/td><td><strong>Smaller Community:<\/strong> It is fairly new in the market as compared to Django and hence has comparably small community support than Django.<\/td><\/tr><tr><td><strong>Built-In packages:<\/strong> It is fully loaded, i.e. has all the libraries already built-in and so no need to install\/import third-party packages. Hence can use several functionalities easily.<\/td><td><strong>Customizable: <\/strong>It is more flexible and hence has only minimal built-in packages. Hence gives space to developers to build.<\/td><\/tr><tr><td><strong>Security: <\/strong>Django provides several built-in options to protect applications from forgeries. <\/td><td><strong>Security: <\/strong>Flask-Security package also provides similar options to protect applications from internet forgeries.<\/td><\/tr><tr><td><strong>Large Projects:<\/strong> Suits large and extensive projects <\/td><td><strong>Small\/mid-sized Projects:<\/strong> Suits small and mid-sized projects<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>That&#8217;s it, guys! Now that the differences between Flask and Django are clear, you can choose what framework to use based on the project you aim to build. See you guys next time! Happy Coding!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Holla guys!! In this article, we will encounter some of the primary differences between Flask and Django. So let\u2019s get started!! What is Django? Django is an extensive web framework built with the idea of making the web development process simpler. It is an open-source python web development framework based on the MVT-Model View Template [&hellip;]<\/p>\n","protected":false},"author":13,"featured_media":8415,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-8413","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python-modules"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/www.askpython.com\/wp-json\/wp\/v2\/posts\/8413","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.askpython.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.askpython.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.askpython.com\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.askpython.com\/wp-json\/wp\/v2\/comments?post=8413"}],"version-history":[{"count":0,"href":"https:\/\/www.askpython.com\/wp-json\/wp\/v2\/posts\/8413\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.askpython.com\/wp-json\/wp\/v2\/media\/8415"}],"wp:attachment":[{"href":"https:\/\/www.askpython.com\/wp-json\/wp\/v2\/media?parent=8413"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.askpython.com\/wp-json\/wp\/v2\/categories?post=8413"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.askpython.com\/wp-json\/wp\/v2\/tags?post=8413"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}