Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Django vs Flask

C7053afe0a49a03b39ecfaa2bd389926?s=47 kracekumar
November 16, 2013

Django vs Flask

When to use Django and Flask, which is suited for your job.



November 16, 2013


  1. Django Vs Flask Django History Initial Release: 21 july 2005.

    q Current Release: 6 Nov 2013 (1.6). q Full stack framework. q Flask History Initial Release: 1 April 2010. q Current Release: 14 June 2013 (0.10). q Micro framework. q Django Components Database layer (ORM) q Templating system q URL dispatcher or router q Form Layer q Admin Interface q Caching framework q More more more q Flask Components Werkzeug routing (DSL) q Jinja2 (optional) q Who uses Django ? Instagram q
  2. Pinterest q Disqus q Pretty much big sites use Django.

    Who uses Flask ? Disqus q Lot of small sites q Django good parts ? Huge community. q Well documentation. q Security is prime focus. q Lot of third party libraries. q Admin interface. q Bad parts ? Regex url routing is ugly (r'^blog/?P\d{4}/$'). q In 2013 it feels heavy but it wasn't in few years back. q Difficult to replace Django auth with custom auth because third party libraries break. q ORM Django - people.filter(age__gt=18).filter(~Q(age=42)) q SQLAlchemy - people.filter(Person.age > 18, Person.age != 42) q Flask good parts ? Very tiny library. q Extensible. q Can build large sites using Blueprint (LastUser). q Has picked up very well. q Flask-extensions. q You can replace all the parts with your library. q
  3. Flask bad parts ? Not all Flask-extensions well maintained. q

    Flask-wtforms broke api thrice :-( q Flask-Admin interface sucks :-( q When to use Django ? To build web apps soon. q If you are new to web development. q When all you need is backend and user can enter data via admin interface. q When to use Flask ? API service. q Building an infra structure. q Small apps. q Final word If you are new to web development start with Django. q If you know web development and know enough about security use Flask. q Backend for mobile app use Flask. q Api only site use Flask. q Q & A - Thank You