8 ms·
Just use django bro
by ninetenel 13y ago
Just use django bro
- llambda 13y ago> Just use django bro I would be fascinated to read your rationale for just using Django. Specifically I'm curious what use-cases you see as Django having an advantage in? (Specific examples make for a much more interesting dialogue.) In relation to this, do you think there are contrasting use-cases where Flask might excel as a more suitable option? Personally, I do not favor Flask or Django or <insert web application suite here> exclusively; instead I evaluate a use-case and then determine which tool best fits my needs. However, it would be amazing if you could somehow show that "just use django" is axiomatic to web development in Python...
- lelandbatey 13y agoIndeed, I'd be curious as well to hear about why someone should use Django. I initially started using Flask because it is the lightest framework I could find in terms of dependencies, boilerplate, and mental-modeling. Additionally, it had EXCELLENT documentation for everything, from the super newbie (me) to the more seasoned expert. Since then I've yet to run into a case where I want a lot more than what Flask offers. However, If there's something better that I just don't know about, I'd love to hear about it!
- jmduke 13y agoI've used both Flask and Django more or less extensively: generally I like to start out in Flask and move to Django if necessary, as opposed to the other way around. The three big things I think Django has over Flask: - ORM - Django-admin - A stronger ecosystem (But of course, none of these are entirely absent from Flask -- its not as if its particularly difficult to plug in SQLAlchemy, and I believe there's a Flask-admin package nowadays.) My general advice is that if you feel like the thing you're developing is going to turn into a CRUD app, use Django.
- glitch273 13y agoI believe Flask actually has the advantage in the ORM since you aren't tied to Django's strictly RDBMS structure and Flask will allow you to easily use NoSQL solutions if that's your thing. Flask with SQLAlchemy is just as powerful as Django's ORM. Flask does have an admin plugin but it's nowhere near as good, polished, or documented as Django's. Django does have the advantage of a bigger mind share, users and ecosystems.
- zalew 13y ago> Flask with SQLAlchemy is just as powerful as Django's ORM. sqlalchemy is more powerful than django orm. > I believe Flask actually has the advantage in the ORM since you aren't tied to Django's strictly RDBMS structure and Flask will allow you to easily use NoSQL solutions if that's your thing easy there. you can as well use nosql with django (orm is useless then, by definition) and you are in the same exact situation as using nosql engines with flask. if you get rid of the orm in django (which is doable), you are just bringing your own batteries here, just as you are bringing them to flask.
- excelMonkey 13y ago"Flask will allow you to easily use NoSQL solutions if that's your thing" Agreed - we normally use flask alongside psycopg2 and postgres but recently we've been using it with NEO4J for fun http://www.coolgarif.com/brain-food/flask-api-over-neo4j-in-python http://www.coolgarif.com/brain-food/flask-api-over-neo4j-in-...
- aidos 13y agoI don't think the ORM concern is valid - SQLAlchemy is probably the best ORM available for python and you can drop it straight in to your flask app. As you say, it really depends on your use-case. I wrote a number of crud apps in Django in a previous life (when Django was still fairly young). I found that out of the box you could get something set up quickly but trying to bend it to your (or the clients) will sometimes required a lot of work. I remember at one point having to duplicate a huge chunk of code into one of my models. That's the tradeoff you'll always run into. You'll get a really complete system for free but it won't be as flexible as you may one day need it to be.
- ninetenel 13y ago> I'm curious what use-cases you see as Django having an advantage in? My primary use case involves having a webapp that actually works
- sillysaurus 13y agoLet's just ignore him. He's trolling.
- coldtea 13y agoWhereas, in your vast experience, you found that Flask webapps don't work?
- aheilbut 13y agoWhat about Flask vs. CherryPy?
- taude 13y agoUse Django when you're an agency making a finite delivery to a client. :) Edit: on a serious note, use it when all the dependencies it comes with matches what you exactly need. Once you're down the path of swapping something out, all the third-party apps/packages (one of the key features) become useless. This becomes problematic when you start to use something like MongoDB and end up having to write a lot of code on your own.
- tbatterii 13y ago> Use Django when you're an agency making a finite delivery to a client. :) or when the client is dictating the tech stack. :)
- fixxer 13y agoDjango is a great framework, but it has always struck me as Python's answer to Ruby-on-Rails. Very structured. Flask is literally a 5-minute ad hoc content management system with all the power to take on massive tasks. The "micro-framework" label is an understatement. I also think Armin's style is quite elegant and I've learned a lot more about the language just from reading Flask source.
- benhoyt 13y agoHow is Flask a "content management system"? I thought it was a fairly small set of utilities for writing web applications, aka a microframework. A CMS is a program/app for publishing and editing web pages or blogs, is it not?
- fixxer 13y agoFlask is a framework for writing applications. You can build whatever. I've used it for blog engines, geospatial models, and much more. A CMS is exactly as you say: a system for managing content.
- nether 13y agoSwitching to Flask from Django was like switching to Slackware from Mandrake (back in the day...). For the first time I was actually learning the system I was using.
- mattupstate 13y agoI hear you there. Flask's code base is really easy to get into if you're curious how things work under the hood.