Sunday, April 14, 2013

How I chose my python framework

I always wanted to learn Python. Even though I never coded in Python, I kept in touch with the community. So, from that experience I can tell you that Python lacked a robust web framework until recently. Django was under development and things were not so easy if you wanted to code for the web in Python.

Fast-forward today, I'm surprised at the number of frameworks that have come up for Python. And honestly, when I started this exercise of learning Python all I wanted to do was,

 sudo apt-get install python-django 
 gedit hello.py   

But now, with so many choices I can no longer think of Django as the Python framework of choice. So, as any good programmer, I did a lot of research, read a lot of opinions and finally settled upon Flask.


I have my own reasons for choosing Flask,

  • I wanted to learn Python, and wanted the journey to be fun. For that I needed a framework without lot of conventions.
  • I did not want to build anything big. I wanted to start small and start quick.
  • I wanted good support from the community.

Flask is a micro-framework. To put it the developer's own words - "Flask can be everything you need and nothing you don’t". 

And, that's exactly what I need. It's minimal, light, comes with a light weight web server for testing and has very good documentation and community. I was able to install flask, write a Hello World application and serve a web page in less than 5 minutes. So, that definitely says something.

One more framework I did a lot of research on was Web2Py. Though I don't agree with some of their design decisions I still think its a great framework for beginners and experts alike. But, as I stated above my goals are different and at the moment Flask does the job for me.

3 comments:

abhinay said...

I love the Flask framework for its minimalism. It is very light weight and it is not bloated. I could write a simple web app in a single python file by importing very few python modules. I recommend Flask to anyone who want to get started with developing web app quickly. Where as, Django has lot of features inbuilt which are not really required or used in your application.

I primarily chose Django because I first started with django and second, it has wide range of third party libraries and plugins readily available. Also, because of its ORM, Admin and many other features.

Happy Coding! :)

Naz Mir said...

@abhinay: Thanks, really appreciate the inputs :)

Dan said...

Thanks, I was in two minds. I guess I will use flask after all.