6 ms·
Rails vs. Django
Just curious, and I want to see which framework I should pursue more aggressively.
So, how about pros/cons of each.
- hsiung 19y agojesusphreak has a pretty good writeup that's worth reading on the pros of using django: http://jesusphreak.infogami.com/blog/why_django http://jesusphreak.infogami.com/blog/why_django Having come from a rails background and later switching to django I think it comes down to a matter of preference. Django's ORM gets the job done but leaves something to be desired (ugly syntax, no multiple database support, also watch out for implicit cascading deletes!). Conversion to using SQLAlchemy was supposed to address the gaps, but the branch for the upgrade seems pretty dead... But overall I'm pretty happy due to the transparency of django's framework code. I've implemented some customizations that would have been a lot harder to pull off in rails. If you had to choose a python web framework, I'd suggest taking a look at pylons which is more flexible (also, by default it uses mako templating which > django's templating and supports SQLAlchemy).
- JMiao 19y agoagreed.
- kashif 19y agoActually SQL sucks and hence all wrappers suck too. The over-engineered SQLAlchemy sucks most. If you are python user you should find SQLAlchemy ugly. As far as frameworks goes, for most deployments(not for all) I would suggest pylons over django. Mako is very useful.
- dood 19y agoI'm curious what you dislike about SQLAlchemy, the ORM, the SQL toolkit, or both?
- kashif 19y agoBoth, but the ORM more. I am curious, why do you ask?
- dood 19y agoI've been learning it recently and I'm not sure what to make of it, specifically the ORM component. It certainly has a good reputation as far as ORM's go, but I'm not sure if even a good ORM fits a large, popular, or complex app, or is perhaps more suitable for protoyping and low-traffic uses. But since SQL is pretty necessary for most web apps, it makes sense to pick some abstraction layer, and as far as I can tell SQLA is best of breed for scripting languages, so I'm trying to work out how to apply it most effectively.
- kashif 19y agoThings I learnt, that might help. 1. You don't have to use SQL. 2. If you are going to use SQL, Find a wrapper that is minimalistic for your current needs. Work with lesser and you will work more but you will also work with more freedom and sanity. Best of luck friend. :)
- gscott 19y agoI know nothing about sql wrappers but I do know whenever I have a scaling problem it is ALWAYS the sql. I doubt if any wrapper will save me from this. As your database grows larger you need to fine tune your sql, indexes, and so on.
- dood 19y agoThanks for your thought-provoking comments, actually I had quite forgotten that I didn't necessarily need SQL (despite reading all the threads about that here)! Trouble is, I understand the theory of in-memory data logged to disk, but as I'm just a humble hacker (self-taught amateur) there seem a lot of unknowns in such an approach. SQL, though a pain, is at least familiar and abundantly documented. Guess I'll do a little more research, and a little more hacking, since I would be quite happy to drop SQL entirely!
- jey 19y ago"Actually SQL sucks and hence all wrappers suck too. " Amen.
- JMiao 19y agoWhat type of app are you looking to build? The scope of the project would carry weight here.
- andyn 19y agoThat and whether you're more comfortable using Python or Ruby.
- SwellJoe 19y agoDeployment of Rails sucks. Django is far better thought out, and can be deployed in a very sane manner. A fleet of Mongrels is just an embarrassingly bad way to handle concurrency. "I know, let's write a crappy barely functional web server, spawn a metric ass ton of them, and then balance between them with a proxy. It'll be most leet and super fast! We'll call it a Best Practice. It'll be awesome." In fact, it's fragile, doesn't scale very well, and is complicated to configure. It's also a huge distraction from solving the problem in a sane way--people seem to think "deploying Rails" is solved by this and Capistrano, when really, it's just a new stack of problems. Otherwise Rails kicks ass, and I like Ruby better than Python (but I'm a perl monger, so I might be brain-damaged into not seeing the beauty of Python). But I do tend to feel like Django is being written by grownups who've got years of development experience, while the Rails folks are making it up as they go along...sometimes going down really poorly chosen paths (I believe Mongrel is an example of this, but I'm no expert). Then again, I think if I were starting an app from scratch I'd pick Catalyst. But I haven't spent enough time with any of them to know which one is really most productive for the way I work. I think you'll want to try them out, and not take advice from random dudes at news.yc.
- davidw 19y agoI went for rails myself, and agree about Mongrel. It seems like the Rails guys are all anxious to throw the Apache baby out with the bathwater, and spend a lot of time fooling around with dodgy ways of doing things. For now, I use the mod_fcgid Apache module, and it seems to work ok for what I need.
- altay 19y agoi heard through the grapevine that zed shaw, the dude who wrote mongrel, is down on it and isn't actively developing it anymore. hopefully someone else will pick up the slack, but i'm afraid that 95% of the folks using ruby+rails are know-nothing newbies (like me). =P anyone have any experience with lighttpd + rails?
- lojic 19y ago
- rms 19y agoWhat about Pylons?
- dood 19y agoPylons is deserving of attention. There is a small comparison of Django and Pylons here [http://wiki.pylonshq.com/display/pylonscookbook/Concepts+of+Pylons#ConceptsofPylons-Arethereotherwebframeworks%3F http://wiki.pylonshq.com/display/pylonscookbook/Concepts+of+...]. I'm playing around with Pylons and have been impressed so far. The whole approach strikes me as more of a hackers framework; less magic, more flexible, extensible. Though the docs need a little work, and the community isn't as big as Django yet, Pylons seems to be blossoming into quite an excellent framework.
- kashif 19y agoYou are on the money dude, I have been using pylons for a while and it is much more usable than Django.
- yrashk 19y agoRails looks to be more DRY than Django. Though I'm on Rails and don't really use Django.
- kashif 19y agoWhat are you designing? One might be better suited.
- hello_moto 19y agokyro, why don't you do this instead: 1) Pick a very easy tutorial for both of them 2) Do them 3) Choose Framework will only get better each day so if today Rails deployment sucks, tomorrow it'll become better unless the growth is stagnant. Same case with Pylons or Django or the 100000000000000001 python frameworks out there. Now if you're looking for a job, Rails would be a better choice because the hype marketing has converted a lot of people (they drink the kool-aid straight from the hose).
- dood 19y agoI don't think this is a good way to evaluate a framework; tutorials don't necessarily bear much relation to the reality of using the tool.
- cnu 19y agoAgreed. Most of the frameworks have the 20 minute tutorial which (most of the time) is no way comparable to the type of work we will be doing with it.
- hello_moto 19y agoThat's right.. in a way. You need to love the platform you're going to develop on top of. Guys like him, that ask which one is better, needs to at least give both of them a try and see which one he likes it the most. Just like the most common comments from the Rails vs Django: it's up to which one you're comfortable/love. I tried Rails, Django, TurboGears and I ended up with ASP.NET.
- nanijoe 19y agoA search on amazon.com for 'ruby on rails' yielded 48 books, a search for Django comes up wuth 3 unpublished books. The stats above, made the decision for me.