Flask vs. Django: Why Flask Might Be Better

When you first started developing Python applications, you probably developed so-called "command line applications". The user has to run these scripts in a shell or command prompt and pass input as arguments or through standard input. Several years ago, the natural progression from building these kind of applications was to build desktop applications — a program that allows users to interact using a mouse and keyboard, which contains menus and other interactive elements. These days, it's more common to transition into building web applications — your users will interact with your program via their web browser. For a nice overview of why web applications are arguably better than desktop applications, see Patrick "patio11" McKenzie's post here: https://www.kalzumeus.com/2009/09/05/desktop-aps-versus-web-apps/.

If you decide you want to build a web application, and you would like to develop it in Python, you'll probably want a so-called web framework. There are a lot of repetitive and boring parts of building backend logic, user interface, and hooking everything up to the Internet so that users can navigate your app in their browser. A web framework aims to implement all the functionality common to most web applications, such as mapping URLs to chunks of Python code.

Exactly what is implemented in the framework and what is left for the application developer to write varies from framework to framework. The biggest difference between Flask and Django is:

  • Flask implements a bare-minimum and leaves the bells and whistles to add-ons or to the developer
  • Django follows a "batteries included" philosophy and gives you a lot more out of the box.

We will now discuss their differences in more detail.


要查看或添加评论,请登录

Milan Hazra的更多文章

  • Let's get Educated on what's trending

    Let's get Educated on what's trending

    Just attended an exciting town hall session with hundreds of other teachers from the Camp K12 community! It is…

  • Wave hello to Soli touchless interactions

    Wave hello to Soli touchless interactions

    Soli is a new sensing technology that uses miniature radar to detect touchless gesture interactions. The Soli chip…

  • Make Your Life Easy

    Make Your Life Easy

    Guys I'm sharing a Google form with you all. Please find some time to fill it.

社区洞察

其他会员也浏览了