4 ms·
Very nice article and thanks for the intro to Requests. Though, I'm not sure we would agree about Django being the best thing to learn in the long run. I under
by mekoka 15y ago
Very nice article and thanks for the intro to Requests. Though, I'm not sure we would agree about Django being the best thing to learn in the long run.
I undertook to move to Python for web development about 8 months ago and embarked on a thorough quest for the one true framework. Obviously Django was the first and most recurrent recommendation. Having briefly toyed with it in the past, I really could see myself commit to it for the long run. The various raving reviews also made the choice all that simple. I was all ready to give it my seal of approval, when I encountered my first complain, which was so compelling that it raised an eyebrow.
It was about an experienced Python programmer explaining that as time went and as he progressed with Django, he found himself increasingly swapping parts out of it for external libraries. SQLAlchemy, WTForms, Jinja2. In the end he had only the routing module and the admin, which wasn't that big a deal for him. He was asking what was the point of using a full-stack framework not necessarily designed with interchangeability in mind, if you end up just using it like a glue mini-framework?
As I dug deeper, I found more similar complains, all from similarly experienced developers, who all ended up adopting something else with a light plugable base approach. I heard of Repose.bfg, Pyramid, Werkzeug and a slew of other ones, that allow you to get down and dirty fast, while still allowing you to get big in the long run.
Just as you, I was recently asked by a friend wanting to get into web applications development to recommend a platform to work from. I also did point to Django, but explained that it wasn't because it's necessarily the best, but rather because it's the gentler introduction. It comes with batteries, crutches, first aid kit and a nice box of goodies, perfect for someone who has no clue what they're doing.
Note that I'm not dissing Django or relegating it as an amateurish framework. I agonized on my decision and still sometimes experience some Django envy (FYI I adopted Flask and don't regret it one bit). Nonetheless, it's hard to deny that it does a particularly good job of introducing newbies to good concepts fast, while at the same time being notorious for getting in the way of more experienced developer than some other frameworks.
- beaumartinez 15y agoDjango is where the jobs are. If you want to profit from your skills, the smart bet is in learning technologies that are in demand.
- mekoka 15y agoI'd say the smart bet is in learning technologies that are relevant and to be comfortable with your tools. I don't recall the last time a client asked/cared what technology stack we're using. They usually just need stuff built.
- anthonyb 15y agoThe issue that I have with that attitude (as an experienced Python and Django developer) is that there's a lot more to it than just "swapping out Django's DB and replacing it with SQLAlchemy". You miss out on most of the infrastructure around Django's database stuff that makes it so easy and worthwhile to use. For example, fixtures. In Django, you can include them in your tests and have it All Just Work(TM): https://docs.djangoproject.com/en/dev/topics/testing/#fixture-loading https://docs.djangoproject.com/en/dev/topics/testing/#fixtur... You can also use them outside of testing, too: https://docs.djangoproject.com/en/dev/howto/initial-data/#providing-initial-data-with-fixtures https://docs.djangoproject.com/en/dev/howto/initial-data/#pr... Fixtures in Flask/SQLAlchemy? Not so much - you have to roll your own (crappy) implementation: http://farmdev.com/projects/fixture/using-fixture-with-pylons.html http://farmdev.com/projects/fixture/using-fixture-with-pylon... http://flask.pocoo.org/mailinglist/archive/2011/3/6/flask-sqlalchemy-and-fixtures/ http://flask.pocoo.org/mailinglist/archive/2011/3/6/flask-sq... Also note that, while I'm picking on fixtures here, Django also has a bunch of other database related features, like introspecting a pre-existing database, and generating a bunch of Model classes from it. Combine that with South and you're 90% of the way there when migrating the data from a legacy system. This has turned into a bit of a rant, but I've seen a lot of half-baked reimplementations in "pluggable" architectures of stuff which Django just gets right.
- mekoka 15y agoIt's not a matter of attitude, it's about having tools, evaluating them for what they're doing for you and making a choice. There's always a conscious trade-off. You can't focus on what's good about Django, as if someone picking SQLAlchemy or Werkzeug is a fool at a loss. The same goes for the other libraries that I listed. In my own case, I'm not particularly a fan of opinionated frameworks. I've had my share of griefs with them. Django looked nice, but I easily could identify with the pains those developers went through when dealing with its lack of flexibility at certain corners. I was new at Python, not at web development, I did not need the hand holding, no matter how nice and clever the code was. This was not a one evening process, I read blog posts, forums, perused StackOverflow and even HN. It took weeks. Feel free to take the journey, then tell me it didn't give you pause. Flask is a small framework that is far from pretending to be what Django is. It's not even at version 1, but with its flaws, I'm quite happy with what it's allowing me to do. I don't mind you ranting about my post, just don't assume that I would use Django the way you do. Stuff that you relish might be what turns me off and the beauty of it all is that it's all acceptable.