Member-only story
Bottle vs. Flask vs. Django — For Python Developers
Know the difference and when to use each of them
When it comes to Bottle, Flask, and Django, you’ll usually see only two of them described in an article at a time. However, these three tools help you accomplish similar tasks when it comes to developing web applications with Python. It seems only right to talk about the strengths and weaknesses of each and when you’d want to use them.
Bottle
Bottle is a fast, micro web framework for Python. It has no dependencies besides the Python standard library and is so lightweight that the module for it is a single file. It handles everything you need to create small websites or applications. It’s also async-friendly, allowing you to easily keep your application data continuously updated. Another nice feature is it comes with a built-in HTTP development server.
It’s a great choice if you’re building something small or if you want to quickly prototype an idea. Because it is simple to use, it’s also great for newer developers. You can easily understand how to use Bottle for whatever project you’re creating and get your application production-ready fast.
One drawback of Bottle is it has less documentation and support than Flask or Django. If you want to build a big, complex web application, you may find your efforts better supported using one of the other tools. There’s also a number of things that Bottle doesn’t have built-in, such as an admin panel, ORM framework, NoSQL support, REST support, security, web forms, or authentication. However, there are a number of plugins and libraries you can use to add these things to Bottle if you want to do so.
The sticking point will probably come back to everything not having a lot of documentation to work with.
Flask
Many developers choose Flask over Bottle because they feel it offers everything Bottle does and more. I would argue that what it has over Bottle is popularity, leading to more documentation, extensions, and plugins being built for use with Flask. If you’re a newer developer trying to do something more complex, Flask might be a better choice than Bottle because chances are someone’s already documented a way to do whatever you’re…