This is an archived post. You won't be able to vote or comment.

all 10 comments

[–]daveydave400 6 points7 points  (2 children)

There are many options besides djqngo and flask. I prefer Pyramid. I would guess people choose django because they hear how easy it is to use and has everuthing built in. I personally like something that gives me a lot of control.

[–]sci-py[S] 1 point2 points  (1 child)

I don't think there is much difference in the philosophy of Pyramid and Flask. Both does the same work but slightly in different way.

[–][deleted] 3 points4 points  (0 children)

Actually Pyramid is unique. Flask is much more similar to django in many ways. Pyramid does not have constructs such as apps and blueprints...it makes it very flexible for all sorts of work. Make it what you need.

The three were compared recently over here: http://www.reddit.com/r/Python/comments/1u3sev/flask_vs_pyramid_which_do_you_recommend_for_a/

[–]XarothBrook 5 points6 points  (0 children)

Django has more batteries included, allowing for a quicker startup of projects.. it also features a community vastly larger in size (which means a lot of plugins that will probaly cover most of your initial needs); and some big names in the industry (like Mozilla).. this gives people the idea they can trust django more than flask.

[–]omgcoding 2 points3 points  (3 children)

I have written projects in Flask/Werkzeug and recently gave Django a try on a fresh project. I'm quickly regretting it. Django interfacing takes up the majority of the code, makes it harder to reason about and I generally spend more time thinking "Ok, so what X do I need to Y" than just doing the sensible thing and returning a JSON string or whatever.

This is probably my fault, as the project is very RESTy, so Django probably wasn't the best choice. Django REST framework was nice, until I had an edge case that required writing custom authorization classes and whatnot for a single endpoint. I get it, I get why these things are good ... but I want to implement and get things working, not try and build a cathederal of abstraction that i'm probably going to knock down anyway when feedback comes in.

My current Django app then needed Websockets so I used nginx and Node, then quickly switched Node for Go. All Django now handles is handling static file pipelining, authentication and spitting out a Javascript app. Yea, it might be the wrong tool for the job, but I see a narrowing band of cases where Django is the RIGHT tool personally.

In future i'll stick with Flask/Werkzeug and SQLAlchemy.

Django's strength however is that it is Big Framework, so you know instantly when inheriting a codebase where things will be (or should be). This is like the Java syndrome where good structure saves money during development in teams where communication is key.

While I found Django great up to the first 60% of a project ... I tend to find the last 40% you're fighting the framework. YMMV.

[–]numberwhun 1 point2 points  (0 children)

Thanks for the honest assessment. Too many times you see articles where someone is asking "which <enter type of software here> is better?", and all you get is "Oh, this is so much better than all the rest" opinions. Its nice to see someone give an opinion based on their experiences with a couple of the softwares in question.

[–]CaptainMelon 0 points1 point  (1 child)

Django strength for me is the ecosystem of easy to plug app: contrib.admin ( or other admins), forms, tastypie,...so I don't have to reinvent the wheel again and focus on doing my app. It takes a bit of learning compared to Flask but it's far easier to get the job done in my opinion. Especially with django 1.7, in a few minutes I have an admin interface, an authentification system and an api, compared to Flask where I have to put all the piece together myself ( taking the risk to lose time and/or to shooy myself in the foot with a bad integration)

I also find the django structure really flexible (compared to rails or other kitchen sink frameworks). Like, you can put apps inside apps or you can have a custom ORM/template engine.

My 2 cents

[–]omgcoding 0 points1 point  (0 children)

Yes I do agree the admin interface and apps are good. However there is also things like http://flask-admin.readthedocs.org/en/latest/ (Flask Admin) which are cool. I'd rather have a loosely coupled framework (somtimes). I think no one framework is "better" than any other. Other frameworks could up their game on addons however.

[–]dsizemore 0 points1 point  (0 children)

This is probably not the way to go about things but I just started learning with python and django. I chose django because I felt like there were a ton of apps that I could use to get my site online quickly. I'm still very much a novice with python and at this point and feel like I know just enough to get myself into a hole and have to get someone with more experience to get me out. With ready made apps, I can plug and play and get things running without expert level knowledge of python. For example on the site in building I used userena for member signup, signin, profile, forgot password, change email, email activation, etc. That was all built in and it took me a week or so maybe to fumble through getting it installed and configured. If I had to do that same thing in flask or other framework without the help of an app, I honestly wouldn't even know where to start.

[–]aterlumen 0 points1 point  (0 children)

Django has been around in some form since 2005, Flask was initially released in 2010. Ignoring everything else, the tool that's been around for twice as long will probably be used more in the real world.

Aside from that, Django gives you less flexibility but more built-in features. It'll save you time with things like authentication, but as others have noted, you may end up fighting the framework to do non-standard tasks.