Take the 2-minute tour ×

I want to take the web development path and have a career as a web developer using Python, and really want to learn django because it's a full-stack web framework and will be more beneficial for me when looking for a job as a web developer.

But a friend told me to begin with flask as it's simpler, and will help me when i start learning django, as django is more complicated than flask. So flask will ease up things for me when i start learning django.

So should i start with flask, knowing that i'll eventually learn django ? Or just begin learning django ?

share|improve this question

closed as not constructive by Sean Vieira, casperOne Oct 9 '12 at 13:13


add comment

7 Answers

I would recommend that you start with Flask. With Flask, you will explicitly write your own route functions, make your routes render templates, etc. all using Python functions you're already familiar with. There is little "magic". You can see exactly how everything is happening and understand why it is happening. Flask documentation is also quite nice and concise so you can read it and learn Flask in a few hours, spend several evenings learning to make a full application, and then move on to Django. The time investment is small, it will give you great preparation for Django, and you'll have learned about a great micro-framework. I sometimes prototype projects in Flask before building them in Django.

Django, while more fully featured, has definite structure and convention so it can be a little more mysterious for a beginner to figure out how everything fits together. If you're new to web development, you might have some confusion about whether you're doing something because its a web development convention or whether you're doing it because its part of the Django conventions/organization.

If you can spend a few days or a week playing with Flask before moving on to learning Django (your original goal) I think it is well worth the time. Both are great frameworks. Welcome to the world of Web Development.

share|improve this answer
Hmmm, i've already started in django. Made some dynamic and static pages, I started to get good grasp of things in it. So do you have a link that explains what happens under the hood, instead of learning flask ? Because you're kind of a convincing talker :D –  Rafael Adel Oct 8 '12 at 22:46
I don't have an under the hood summary of Django, unfortunately. One thing new developers are often confused about is how routing works. Here's the description for Django routing docs.djangoproject.com/en/dev/topics/http/urls and here's the description for Flask routing flask.pocoo.org/docs/quickstart/#routing It sounds like you've made a good start on Django already. Check the Django Tutorial if you haven't already - its pretty decent. –  dghubble Oct 8 '12 at 23:41
@dghubble Thank you VERY much for your well reasoned, well written answer. I know this question was closed as "not constructive", but I gotta tell you that your answer helped me figure out what Flask is, and how I might approach things moving to Python as my primary webdev language. You rock! :-) –  Vivek M. Chawla Apr 24 '13 at 14:59
@dghubble: If I am making APIs for mobile apps. Is flask a better choice ? –  Amogh Talpallikar Sep 6 '13 at 11:39
@AmoghTalpallikar Check out Flask-Mobility for Flask and django-mobile for Django if you're serving up templates. I would not say Flask has any advantages over Django in terms of mobile support. In fact, I think Django's maturity means it may be better if you have uncommon mobile API needs. –  dghubble Sep 8 '13 at 6:01
show 2 more comments

IMHO I would go straight for Django. It very well may be harder to learn for a simple app or website, however, I would say that the amount of support and docs that are available online far outweigh any other Python web framework.

Also, as you say, Django is a real world use framework. If you plan to use that, it could be a waste of time to learn something else and then unlearn that to learn Django. (as any shift of technology involves some unlearning)

This is all subjective and only my opinion.

share|improve this answer
add comment

Flask is a micro-framework but this does not make it simpler.

It just doesn't make many assumptions about the ecosystem/libraries you're going to use. It leaves it up to you.

Which in turn, I think this means it is addressed to far more experienced developers.

Django has a steeper learning curve because, as you said, it is full-stack. It enforces upon you its own ORM, form framework, etc. But it abstracts a lot of complexity that otherwise you'd have to deal with.

I agree with Daniel. I'd go straight to Django if I were in your position.

share|improve this answer
add comment

I had same situation when wanted to try Python for web development :) And I went with Django. While sometimes it is hard to understand all the magic behind of Django, it is nice and full of very helpful things. If you like ORMs, then Django has good one. It also has admin panel. Generic views is also good thing :) Basically it is very nice framework and when you will run your first app online, development of the second one will be fun :)

But after some time, I found Flask. And now I'm working with it. Why? Because sometimes I just like to build and create things by myself, I want to learn and know how things are working. Flask is minimalistic thing and you will create all the "magic" Django already has. I'm happy that I started with Django, just because now I can use some principles from there in my Flask apps. Flask has less users, but so far it was not a big deal for me. It also has extensions which already helping you with some stuff. And while ORM is not built in so deeply as in Django, I like that, because I do hate ORMs (call me old fashioned, but I still think raw SQL is much more effective in my cases).

Best thing would be to try both and choose the one you like. Experienced guys can give advices that one is better than another one, but I would say - try! If you see that you are breaking legs with Django, maybe Flask will help. Or other way around.

Have fun!

share|improve this answer
The Django Admin Panel has advantages (CRUD out of the box) and disadvantages ("hides" code). I think Flask and Django are great, so I agree with Ignas. –  Timo Jun 28 at 11:44
add comment

You should start playing with both and use the one you like if you're not obliged to use one. Also note that learning one of them will most likely make it easier to learn the other.

share|improve this answer
add comment

So, I am not sure you are comparing Apples with Pommes here. I am an experienced Django User and have just started to use Flask. Django's philosophy from early on was that it should be a batteries included framework, whilst Flask is very much a find-your-own batteries approach. The question is, do you want to have a framework which is all you need for the time being to learn how to construct rich websites, or do you want a framework which is just the very basics and you are comfortable weighing up the options out there for all the nuts and bolts?

Additionally you state that you are looking for a career in web development and a toolbox to go with it. I find that even today employers have often at best 'just heard about' Django. Convincing someone to employ you and your go-to framework is Flask may be an even harder sell.

My 2cents would be to get stuck into Django and build some straightforward sites (Polls, Blog, etc.) then when you feel comfortable, go back and build them again using Flask. In the end, it's all Python.

share|improve this answer
add comment

it honestly depends on what you are doing. ultimately as a python developer you will use both. probably django for content based sites and flask for web applications. django's orm makes things for content sites much simpler. you can hook things like sqlalchemy in with flask but i imagine most of your work as a dev will be content based sites using django and its conveniently created admin site from the ORM. I have looked at flask and altho you may get up and running faster with flask django offers much baked in generic views for common tasks such as date based archives which would not be so quickly created with flask. the two serve two different purposes in my opinion. also django is loosely coupled so you can replace parts that do not serve you, template system, comment system, etc . ..

both have good documentation but django has a great community on freenode to back it up. when the docs fail, there are plenty willing to help you in the irc most of them active devs on django themselves as an open source project.

Another + for straight to Django UNLESS you are already highly experienced and can milk flask for all its worth.as stated its a micro framework. it expects the dev to do everything and has little pre baked code.

share|improve this answer
add comment
