DEV Community

Cover image for For a beginner in Python, which web framework would be the best to start learning first?
tcs224
tcs224

Posted on

For a beginner in Python, which web framework would be the best to start learning first?

Did you know you can make web applications with Python?

You need a web framework or web module to do so. There are many frameworks available for this purpose: Flask, Django, Tornado, Bottle

Any of these frameworks will do, but the learning curve and popularity is very different. Picking the right framework is an essential decision, because it's easier to change a framework before you start a project than after you have 100s of code files.

Yes, you can do everything without a framework (manually), but for beginners that's not recommended and for professionals that's usually a waste of time.

Before learning a web framework, you should learn Python.

Popularity

You want to use a popular framework, because of available jobs, rich community and wide support and maintenance of the framework. See this survey (2009) from stackoverflow (not all are Python frameworks):

framework popularity

Flask and Django are the most popular Python frameworks. While Tornado and Bottle are simple, you probably want to go for the first two.

Django

Now Django isn't really suited for beginners in my opinion, it takes a lot of time to setup, but it's a good framework if you know what you are doing. There is a lot of documentation for the framework available [1][2]

Django is a more complete framework that is best suited for heavy back-end and thin front end (JavaScript) sites. It makes a lot of decisions for you, like by default it uses an ORM.

Flask

Flask on the other hand lets you start quickly and you'll gain an understanding of routing, templating, macros, and the markup language used in the Python web framework.

You can build large sites with Flask, for example the popular website Pinterest was created with Python Flask.

Flask is an extremely lightweight web framework. I would recommend learning this, because not only it will gain you an understanding of we frameworks but you will learn more about Python than if you use larger projects like Django.

Related links:

Oldest comments (0)