Web frameworks make life much easier when building robust, scalable web applications. Why reinvent the wheel and build everything from scratch yourself? They are used by everyone from small startups to some of the largest sites on the Web.

There are multiple web frameworks available in Python: Django, Flask, Pyramid, Bottle, and several others.

Practically speaking most projects choose either Django or Flask, which are reviewed below. If you’re a beginner, I recommend Django due to its opinionated approach and better learning resources available.

Django

Django is a very popular option that has a “batteries included” philosophy of including common functionality by default. It has built-in templates, authentication, URL routing, database models, and more. It is used by large web applications including Instagram, Disqus, Bitbucket, Pinterest, and others.

If you’re new to web development, Django is a good place to start. It has fantastic documentation and a rich library of books and online tutorials available to get started. Note that Django remains under active development so look for a tutorial/book that is version 1.11 or newer.

Free online tutorials:

Books: I have a curated list of up-to-date Django books.

Flask

Flask bills itself as a “microframework” that has a small core and is designed to be extensible. Unlike Django, it does not have built-in common functionality but instead relies upon the user to decide 3rd party extensions to use.

Due to its minimal footprint, it is simpler to spin up a sample Flask app than a corresponding one in Django. However the user must make all decisions around what authentication, database layer, routing, templating, and other extensions to add.

Free online tutorials:

Books: I have a curated list of up-to-date Flask books.