share
Stack OverflowRails or Django? (or something else?)
[+326] [36] Kyle Cronin
[2008-09-18 11:51:22]
[ python ruby-on-rails django web-frameworks ]
[ http://stackoverflow.com/questions/91846/rails-or-django-or-something-else ] [DELETED]

This post is from the early days of Stack Overflow, and while we recognize its historical significance, we also recognize that the current community of users will likely close similar posts. Please feel free to read and learn from this post, but refrain from creating similar posts just because this one exists.

I'm interested in learning a web framework. The two big ones, as I gather, are Rails and Django. Which one is better and/or faster? Is one better designed or more logically consistent than the other? Is there another framework I should look into? How easy is it to set up and administer a Rails or Django server, and how easy is it to find a shared hosting plan?

To give a little background, the websites I'm currently used to making are in straight PHP (no framework) and I'd like to be able to manage some of the complexity that comes from feature creep. Outputting HTML with echo becomes a lot less fun the more you have to customize it. In addition, I don't know either Ruby or Python so I'm free to go either way.

note: I'm not interested in ASP. I'd like to develop on a Mac and deploy to Linux/FreeBSD and I don't think that ASP fits the bill.


To everyone that's replied so far: thank you! Choosing a web framework can be a difficult thing, so I'll try to narrow down what I would like to do.

First, I would like to build small, custom sites (hard to call them "apps") that serve data from a database, and optionally an administrative interface to manage everything behind the scenes. As an example, I have a website for my grandmother to showcase her artwork built in PHP. I've spent more time on the backend than the front end to enable her to reorder, relabel, and reprice her artwork as well as upload an image, tag it, and have it scaled and appear on her site.

I notice both frameworks generate "scaffolding" that can be used as a rudimentary admin interface; how would they handle non-textual data (like images)?

Also, when watching a Rails screencast, there was a casual mention that the framework does some singular/plural translation. This strikes me as quite odd - is this what is referred to as "magic" in Rails? If so, does Django (or any other framework) have a more sensible naming strategy?

What part, that the question is subjective? - Thanatos
(67) Don't worry about violating the FAQ; if you don't like a question, vote it down, if you like it or find it valuable, vote it up. I find it interesting that this question has had 272 views, but no votes either way. Unless they're cancelling each other out, of course. - Charles Roper
The only votes on this question are a downvote and two upvotes (Carl Meyer, Thanatos, and ...you?). What I've typically found is that answers usually get a lot more votes than questions (just look at the number of badges for great/good/nice answer/question). - Kyle Cronin
(1) Not exactly worthy of me adding an answer, but worth mentioning: Django's Automatic Admin is Production Ready, and highly customizable. (I think you should continue research on both, and other frameworks). - anonymous coward
Which framework did you choose at the end and why ? - Jakub Czaplicki
(1) Watch a great video "Snakes and Rubies", in which the creators of Django and Ruby on Rails are presenting and comparing these two frameworks. It's been almost 6 years since that meeting and some things have changed, but the conclusions are still valid and clear. In short, these two frameworks are both great, but made for slightly different purposes. Also, the both languages are beautiful but aesthetically different - some people prefer Python, some people like Ruby more. - Andrei
I find it interesting that so many of the post are pro-django on this thread on SO considering rails is a more mature and widely used framework, which is still very innovative - Scott Schulthess
[+191] [2008-09-18 14:06:06] Justin Lilly [ACCEPTED]

From my experiences, rails seemed to be more of a black box than django. You issue some command and some stuff happened and you got a basic CRUD application. You run this particular function and something happened and you got something else as an output, not knowing what the middle bits were. While this is fine for easy things, the lack of online documentation (in my experience) was a huge hindrance.

Django, on the other hand, seems to be more logical and transparent about what's going on behind the scenes. There's no "magic". Django is also one of the best documented open source projects out there.

Just came back and saw your additions:

If you want something with an extensible admin, pick Django. This is a test in which Django shines. Its clean looking and is extensible. In my experience, the Rails scaffolding is typically thrown away as you add more functionality. Its meant to get you up and going, but not necessarily something you'll see in production. That being said, lists for grandma aren't exactly production :) Reordering field and such is fairly easy, especially given the many community contributions to the admin.

When people talk about "magic" in Rails (or any other framework for that matter), they're really talking about things happening without it being immediately obvious why or how. A key example of this is Rails' find_by_* function. Its autocompleted function that you don't explicitly define, but its just "magically" there. You can find a lot more information at http://www.stephenbartholomew.co.uk/2007/6/4/is-rails-magic Purely antecdotal, but I've found that Python (and Django) itself is much more explicit where as Ruby (and Rails) rely a lot more on convention ("That's just the way its done.")


(70) Python is almost as dynamic a language as ruby. The big difference between Django and Rails is more in the philosophy of their design. Python people like libraries to be transparent and obvious how they work, while Ruby people tend to provide clean and pretty interfaces with "magic" behind the scenes. That said, both Rails and Django can be inflexible and problematic in different ways. I have yet to find a perfect way to make web apps. Hopefully Pylons will help. - Nick Retallack
(52) @John: completely incorrect -- Python is not compiled. See the wikipedia entry on the language for more. - alberge
(29) @John: Python is exactly as dynamic as Ruby is. There are implementations of both languages that compile them to various bytecode engines, but they do so to implement their dynamic features, not to remove them. A dynamic language simply adds a level of indirection to every call in its bytecode than would a static language like C# or Java. - Brandon Rhodes
(1) I don't know if this is a lack of proud or something like that but about 1 year ago I start question myself "Why do I think I can do it better than entire teams of smart open source programmers?" or "Why do I think whatever they do is factible to be wrong?", So I started to accept that "magic" and be happy with that. I trust these guys made a great work and, whatever is happening behind the scenes, is happening fast and right. +1 for Rails from me. - Erik Escobedo
(1) It's not a lack of pride. What do you think you know more than a team of open source developers? Your domain. Knowing how to tune the great piece of software they made to your domain and your actual problem is the whole reason you're getting paid. Otherwise, people would just install rails and be done. - Justin Lilly
(23) Regarding Rails "magic". See Clarke's third law: Any sufficiently advanced technology is indistinguishable from magic. - Julian Mann
(1) @Brandon: Python's String class is immutable, which feels a bit less dynamic IMO. But you were just saying it's not compiled, which is right (well, at least they're both not statically typed, we can all agree on that). - rogerdpack
(9) Regarding Django's lack of "magic". See Niven's law: Any sufficiently advanced magic is indistinguishable from technology. - Joe D
(3) This "magic" vs. "non-magic" assertion is tired and old, propagated by people who don't really want to explore another framework because they'd rather stay entrenched in theirs as though expanding their mind and options are a bad thing. What attracts me to Rails is that so much is done for me. More lower level stuff is abstracted away. It's not magic. But it does help me code faster and it does help me focus on other things. If I ever want to know what Rails is doing, I can jump into some well documented source code and find out. I usually don't. Same with Django. - danneu
I'm hesitant to bother with a framework where the most commonly cited "feature" is always placed in quotes. - Dolph
(1) The scaffolding is a bad example of magic and really show's the answerer's lack of experience with Rails - Scott Schulthess
(2) @alberge: Actually, Python is compiled to bytecode, so it's just as much a compiled language as Java is. The only difference is that with Python, the compilation is done behind the scenes when you "execute" a script file. - Mitch Lindgren
(2) The Is Rails Magic post appears to be down. Here's the Wayback archive: web.archive.org/web/20101114035010/http://… - PhpMyCoder
1
[+101] [2008-09-18 11:54:27] Hyposaurus

The eternal question.

The answer: try both and see which one fits best for you.


(11) Try other as well! - Jrgns
(113) You can't get a sense of what these complex frameworks are about with just a few hours of dabbling. You'll just get an incorrect impression that way. Choose ONE and take the time to learn it. Otherwise, you're just messing around and wasting your time. - Ethan
(18) About "The answer: try both and see which one fits best for you.": That attitude is the opposite to stackoverflow objective. If there are outside more experienced developers, why not ask them? If a I have to try ever possible technology outside, I will die before take a decision. - Nisanio
(6) @Nisanio: Not for a question like "Rails vs Django". Experienced devs might be able to provide some higher level insights and comparisons between frameworks, but someone who has zero experience with either platform can't go wrong with giving each one even the smallest shot. @Ethan: It doesn't take much time to make a basic app on either. You won't hurt yourself by expanding your mind and making a small app on each one to see what you naturally resonate with more. You don't need to experience the "nuances" of Rails or Django to get a basic understanding of their differences. - danneu
I agree with this answer, except I would say to try the language it self (ruby or python) and see what you enjoy more. From a framework i would say rails, but I'm biased because that's what I enjoy and use. Ive tried python, but could never get into it myself. I haven't tried Django. There is more "magic" behind rails, as there's a lot of middle ware and nice methods that are provided for you. It's not necessary to understand whats going on under the hood yet. Just learn how to use it, then learn how it works. - agmcleod
2
[+76] [2009-03-13 19:42:18] Lakshman Prasad

I would like to quote [1] to you from one of our blog post's [2] comment:

One of the main reasons I jumped from RoR to Django was the documentation.

The community and the admin interface are both wonderful, but the documentation is what sold me.

If you are learning, documentation is really important. You don't want to google to find blogposts which talk about this feature in an earlier release, and broken now!

[1] http://42topics.com/blog/2008/06/an-interview-with-adrian-holovaty/#comment-381
[2] http://42topics.com/blog/2008/06/an-interview-with-adrian-holovaty/

(5) I'm learning Rails now and have been at it for 2 weeks. I have an application that has a little over 600 tests. I have to say the "hype" of how easy it is is bullshit. Things don't "just work" if you do it a little different than they want you to. The documentation is awful. And you are correct: searching on blogs is a giant waste of time. Even Ryan's screen casts are mostly out of date now or there are better ways to do it. I am not saying Rails is bad - I am saying it is not very consistent and your experience/intuition probably won't help you. - Fire Emblem
(6) I think Rails can be really productive, but you have to spend considerable amount of time reading some good books and developing code for "every type of situation" to really be good at it. Sure the examples on the web look easy - until you try subclassing your models, or try to override the setter for a belongs_to relationships, or namespace your controllers, or any other kind of reasonable thing you might want to do. All of a sudden, you'll start wracking your brain wondering why there's not many examples and why it doesn't "just work" anymore. - Fire Emblem
(2) There are more books about Rails than Django, and you're insinuating that the Django team/community does a better job of documenting releases than the Rails team/community. Not sure if that's actually the case, but I'd guess not. - Scott Schulthess
Fire Emblem, in case if something doesn't "just work" for you, you should do a code review to check if you are doing it right robots.thoughtbot.com/post/2831837714/… - Andrei
@ScottSchulthess It's quite possible and logical. Quality over quantity. 100 people writing 1 book is probably going to make a far better book than reading 100 books written by 100 different people. - Loïc Faure-Lacroix
@LoïcFaure-Lacroix quality and quantity are both good - Scott Schulthess
I have to disagree. Simple example, on stackoverflow duplicates get closed. There is no point to answer multiple times the same question when there is already a good answer. It would make it much harder to find the good answer. I'd rather read one book that incorporate everything I need than having to search that book that talks exactly about what I need which may be 5% of the authors. Scattering information isn't a good thing. That is why having a good documentation is far more better than searching across blogs for good tutorials - Loïc Faure-Lacroix
3
[+58] [2008-09-18 16:30:45] Slavus

I have read somewhere : If you know Python then use Django, If you know Ruby then Rails


(6) This is the most correct answer by far. - Andrew
(2) +1 , but I know php :P - Jashwant
+1 for being funny, and giving me a good laugh :) - scientist.rahul
4
[+58] [2008-09-18 16:31:30] Will Sargent

Both Ruby and Rails have more 'magic' involved. This makes development very fast when you understand the magic, but frustrating when you don't. The documentation is also scattered; some of the newer features of Rails are only mentioned in blogs, or passed along by word of mouth.

Django is extremely well documented, and Python is likewise a 'no-tricks' programming language. It's not quite as 'fun' as Ruby, but it sounds like it would probably suit your need better.


Very good point, but I think fun is what you make of it. - simplyme
(29) I've tried both and I would say Django is more "fun" because it's easier to learn and has less "magic". - Ryan Thames
(7) @Ryan I agree... personally I like to understand what is happening. Learning is more fun to me than saying to myself "wow, something happened behind the scenes and then it worked!". Also, in my experience, you ALWAYS get to a point where you've got to figure out the magic. - TM.
(7) Um, there's nothing 'magic' about the Ruby language. There is, however, due to Ruby's metaprogramming abilities a greater potential FOR 'magic'. - banister
(1) @Ryan I think he was saying that Ruby funner than Python, not that Rails is more fun than Django FWIW. - rogerdpack
(3) @banister Agreed. The ruby programming language is a very straightforward scripting language--no more magical than python. Rails is magical because Ruby has powerful metaprogramming features. - Jarsen
"powerful metaprogramming" is not "very straightforward". What's more, it makes inventing magic more fun, So creating stuff like Rails is fun, using it not necessarily so much. - Torbjørn
5
[+45] [2008-09-18 11:57:44] DeeCee

I think it depends if you like to code in Python (Django) or in Ruby (Rails). The Frameworks are both very well designed and working well. I would prefer Rails because i like ruby :)


Rails has a pretty huge DSL which means for real rubyists it doesn't feel much like Ruby. Frameworks like Ramaze or Iowa fit this category much better. - Fabian Buch
@Fabian that is true but you have to remember that a large chunk of "Ruby programmers" have only used Ruby for Rails. - TM.
(4) I pick Rails for the same reason. Ruby is beautiful! - ohho
(5) Ruby is like the miss Universe in the programming language world. No language has more concise and beautiful syntax. - RubyFanatic
6
[+41] [2008-09-18 14:23:00] srboisvert

My take on it is that Rails is more popular, more trendy, more volatile, more complicated and more versatile.

Django, on the other hand is more organized, better documented and comes with authentication and administration built in.

So if you want a fast evolving slightly crazy and egotistical community and framework go for rails. If you want slow and sane go with Django. I choose the slightly crazy.


I'm surprised to read these comments about the ROR documentation that I find awesome, maybe this was true back in 2008? - ecoologic
7
[+27] [2009-11-09 01:58:07] Pedro

One word : Cucumber.

I prefer Rails because it has more test tools. You can use tons of very inspiring test tools. I can barely think about using rails without Rspec, factory girl among other tools, and the new cucumber gem is just incredible.


(3) Python has Lettuce - dan-klasson
8
[+22] [2008-09-18 12:06:44] rnicholson

I'd like to develop on a Mac

Then Rails may be a better fit. Apple seems committed to having a good out of the box Ruby/Rails development experience. (Pre-installed ruby and rails gems + other dependencies)

Although, to be honest the Python/Django experience is just as good, just maybe not baked in and fully supported by Apple.

Its a little dated now, but this comparison of both [1] has some good info on both. Try them both out and see which suits your needs.

[1] http://docs.google.com/View?docid=dcn8282p_1hg4sr9

if the alternative is windows... damn yes! but I'm happy in linux with rails - ecoologic
9
[+20] [2009-03-15 03:07:29] David Berger

Two cents from a Django user who has never used rails:

Django is most intuitive when you are writing custom public views and accepting the admin interface more or less as is. There is a lot of customization that you can do without much trouble, whether it's customizing style, specifying which fields will be editable, or specifying what type of html form elements should be used by selecting a widget. But if you have to make particularly powerful edits to the admin site, this will probably require the most detailed understanding of python syntax and idioms. Your first few python tutorials will likely skip all the details of new-style objects, decorators, Meta classes, and other syntax introduced in releases of python 2.x.

I'll say the same holds for more complicated SQL queries. (My guess is that every ORM framework is going to require more detailed knowledge for more intricate SQL queries.)

The good news? Even though Django itself is heavily powered by the newer python features, a few introductory python tutorials will be fine to let you do most of what you need to do in Django. And, once you read the four page Django tutorial, you'll feel like you can 50% build your site.

Oh, and as for non-textual data, I haven't actually used this, but I believe it is supported by default in the ORM. This probably won't mean too much to you right now, but others can comment on it:

http://docs.djangoproject.com/en/dev/ref/models/fields/#filefield

Anyway, as far as I know, everything supported in the ORM has a default admin interface, so it should be doable out-of-the-box.


I agree with the "50% knowledge thing". After looking into Django docs and tutorials for just one day, I already felt able to develop a small app with it. But of course, there are many features that I still had (and still have) to discover :) - Danilo Bargen
10
[+19] [2008-09-18 12:05:21] danivovich

Ultimately it depends on what language you'd rather work in. If you are comfortable with PHP already, then you may want to look at http://codeigniter.com/ which is a framework similar to Rails, Django, Pylons, Spring etc, but in PHP which you are already familiar with.

The other factor to consider is the server. With passenger (mod__rails) shared hosting now has a much better way to offer Rails hosting. mod_python should help you with Pylons or Django (python based frameworks)

How much customization are you looking to do? Would a content management system like Joomla or Drupal work for you?

Rails and Django are really easy to work with on your local computer since they have test servers that can be run right from scripts in their installation.

Better is a subjective term, and faster depends on what you are doing with it. If you don't want to learn another language, go with code igniter. If you want to learn ruby or python, then play around with both rails and pylons or django, and then look at what your hosting options are.

I don't know much about SQLAlchemy but it is supposedly a great ORM package that is only an option when using python. So if you need a very flexible ORM, then maybe python is the way to go.


There are some hacks to get SQLAlchemy to work with Django, but in general you'll need to use a framework like Pylons or TurboGears if you want to use SQLAlchemy as your ORM. - gbc
(3) Just a note, nowadays mod_wsgi is the "preferred" way to host a Django app, rather than mod_python. - TM.
I'll second drupal, although I have not used it for years. I know we (Thoughtworks) have been using it more as another suggested solution alternative to rails or django. Especially if you are already familiar with PHP, there will be a much less learning curve. - Xian
Last I checked, CodeIgniter lacked some (what I consider to be) crucial features, most notably url generation that conforms to defined routes. - Brian Warshaw
(10) Codeigniter is not similar to rails at all. - Keyo
When considering CodeIgniter, you should also take a look at Kohana, which was initially based on CodeIgniter. But I agree with Keyo, it's not similar to Rails/Django at all. Oh and by the way, Drupal can be PITA to update (depending on the number of modules and frequency of updates). - Danilo Bargen
(1) @Danilio - Spot on. No models (orm), No modules(plugins), procedural forms, no controller testing, no middleware. Codeigniter is easy, but lacks the structures and organisation of a proper framework. It's often recommended as a beginners framework, by beginners. There is a Dunning–Kruger effect here. People think it is a good framework because they've never used properly structured frameworks long enough to see the benefits. When your project grows you'll find out how lacking it is. Drupal is also a pain for people who program. Deployment is painful because of configuration in the database. - Keyo
11
[+16] [2009-08-03 08:42:31] stefano

I've tried both Rails and Django.

Personally, I prefer python syntax over ruby, but I think Rails is one step over Django.

I like how rails plugin system let you build a complete webapp in a few hours and especially I like the way rails and ruby support TDD and BDD.

From the other side, Django has a great pluggable app system and this is probably the most "to have" feature on rails.

Cheers, Stefano


12
[+15] [2008-09-18 23:28:34] Ryan Bigg

Rails has a very good plugin called paperclip [1] which allows you to attach images to records in your database. It stores them on the filesystem and a link to that file in the database. Paperclip will automatically scale your images as you upload them as well into any number of sizes you wish.

Scaffolding in Rails is generally only good for text-based interfaces. Once you get into file uploading, you'll want to look at a good tutorial (or the paperclip documentation) about that.

The singular/plural translation is when you have a table called "forums", the model that corresponds with this is called "Forum". This is so when you do something like Forum.find(:first) you're effectively telling rails to "find me the first forum" not "find me the first forum**s**". Tables and Controllers are always plural, models are always singular. You'll learn all about this in any good Rails tutorial or book (e.g. Agile Web Development with Rails 3rd Edition [2])

If so, does Django (or any other framework) have a more sensible naming strategy?

What's not sensible about that?

[1] http://www.thoughtbot.com/projects/paperclip
[2] http://pragprog.com/titles/rails3/agile-web-development-with-rails-third-edition

Thanks for the paperclip tip! About naming - it strikes me as odd. It has complicated language-parsing abilities that might (I don't know) fail on edge cases - and without any tangible benefit. I could live with it if I had to, but I guess I don't understand the rationale behind it. - Kyle Cronin
(2) I've never encountered a situation where the naming has given me grief. I don't know the rationale behind it. - Ryan Bigg
(6) The rational behind the naming convention is communication. What's in your users table? Well, Users. It's more natural to communicate about groups of things in plurals. However, if it bothers you, you can always turn it off. - PJ Davis
Personally I prefer singular table names, but it's something I learned to live with in Rails. Forum.find(:all, :conditions ...) is more common than your example... am I telling rails to find all the forum? Fora? Forums? Not really sure... Singular table names make for cleaner SQL. SELECT forum.name vs. SELECT forums.name - Alex Neth
13
[+14] [2009-10-29 16:25:15] Piotr Sarnacki

For everyone that says about magic in ruby or rails: http://gilesbowkett.blogspot.com/2009/07/do-you-believe-in-magic.html


14
[+13] [2008-09-18 13:35:44] liangzan

Besides the obvious issues(whether you like python or ruby) you may want to look into the deployment issues with both frameworks. If you choose Django, you'll be able to use Google Apps. If you choose Rails, there's no Google Apps. But there're many other good options such as Amazon EC2/S3. Deployment used to be a hairy issue with Rails, but with mod_rails, I guess its no longer an issue.

Another issue could be the local community. If there's a vibrant community of Python coders in your city, it'd be better to join them. It always feels better to have other geeks around who can help you.


You can run Rails on Google App Engine, but it is so much better to use Heroku to deploy your Rails apps for free in an incredibly easy way. There are many other options for Rails if you need to deploy a serious app with limited budget - Andrei
15
[+12] [2008-09-19 19:00:52] Charles Roper

There was a good article posted back in January (so it might be a bit out of date now, knowing the speed these frameworks move at) in Smashing Magazine:

Frameworks Round-Up: When To Use, How To Choose? [1]

It may help in your research.

[1] http://www.smashingmagazine.com/2008/01/04/frameworks-round-up-when-to-use-how-to-choose/

16
[+12] [2009-01-23 22:38:19] Chris Tosswill

I enjoy rails. However, as some have said, Rails moves quickly. They seem to adopt and then drop 'standards' very often. Google searches return outdated and broken ways of doing things as the top or near top hit.

That all said, rails is very powerful and if you can get up to speed it works wonderfully.


17
[+11] [2008-11-04 20:09:30] Ckhrysze

For the most part, I agree with others here. However, I'm fairly familiar with rails, and pretty familiar with django. I've found that knowing python gets you a lot farther with django than knowing ruby gets you with rails. That said, they are both very powerful, and will likely be able to do anything you would want.


Thanks for your insight. Can you please elaborate on what you mean by "knowing python gets you a lot farther with django than knowing ruby gets you with rails"? - Kyle Cronin
(10) Rails is much closer to a language in its own right than django is. Django setup and use looks like python code, and knowing python makes reading examples pretty easy. There are a lot of quirks in rails that knowing ruby won't prepare you for. - Ckhrysze
18
[+11] [2009-06-02 19:40:56] Alcides

I've written a blog entry about Rails vs Django [1] that replies to your question.

Since you will just need to display (or insert or something) data and have an admin interface, I'd go for Django since it gives you that out of the box. On everything else, I'd say it's a tie, but the post explains it in detail.

[1] http://wiki.alcidesfonseca.com/rails-vs-django

19
[+8] [2008-09-18 13:16:42] Ben Scofield

You may want to take a day or two and try out CakePHP [1]—not as an end in itself, but as an introduction to the concepts behind Rails. Last time I checked, Cake was the closest to a port of Rails of any framework. If you like it, you're more likely to enjoy Rails (and conversely, if not, not)

[1] http://cakephp.org/

20
[+6] [2008-09-18 23:19:46] Sarah Palin for President

They're both excellent, but very different. Personally, I prefer Python, but find Django overly difficult, especially for mere mortals. There's not really any significant alternative to Django.

On the other hand, if you like Ruby and the rapidly growing toolsets around it, but don't like Rails itself all that well, it's worth looking at Merb, too (merbivore.com). I'm having a Ruby on Merb project written for me right now by contractors, and I can tell you I'm flat amazed at the productivity they're getting in this environment - and I'm not all that easily impressed...


I'd just like to give a thumbs up to Merb. If you're looking to build smaller sites, this is definitely one to have a close look at. - Charles Roper
Merb and Rails are merging soon, and will become Rails 3.0 - guns
21
[+5] [2008-09-18 11:56:15] fijter

I'm a PHP developer as well and I really like Django; I have no experience with Ruby on Rails though;

You can also use a PHP Framework offcourse, a good candidate is Symfony [1]

[1] http://www.symfony-project.org

Nice, that's where I came from as well. - orokusaki
22
[+5] [2008-09-18 12:05:47] Christian Davén

Since you're using PHP, I'd recommend CodeIgniter [1]. It's well-documented and has a nice set of functionality without being too complex or bloated. I'm using it all the time!

Edit: I haven't used CodeIgniter since 2009. Kohana is a neater alternative, but if you're really serious about your apps, I'd suggest looking into Symfony [2] (what I'm using at work as of 2011). Symfony is much harder to learn -- and cheat sheets are mandatory -- but it's much easier to create "enterprise" applications.

[1] http://codeigniter.com/
[2] http://www.symfony-project.org/

(1) codeigniter is no match for frameworks like symfony, ror and django. but for smaller, mid-sized applications, it shines. and the other frameworks aren't bloated =) - never_had_a_name
Codeigniter is pretty bad. It cuts a lot of corners. For instance the forms library isn't even object oriented (no field objects). Beginners love it because there is nothing to be learnt. No standards or structures in place to actually improve your code. Just keep on doing the same cowboy practices. Even for a small project codeigniter isn't really suitable since you have to write all the repetitive crap yourself (queries, form html, auth library, database). With django you can just write a very short model, and have the database tables, admin backend and any form html generated from it. - Keyo
+1 for symfony! - Marin
23
[+5] [2008-09-18 14:32:19] Thanatos

An alternative to Rails that is less restrictive of your design decisions is Ruby framework called Merb [1].

[1] http://merbivore.com/

24
[+5] [2011-01-18 18:25:39] Andrew

I would strongly encourage you to try the first chapter or two of several intro books and make your decision based on which is the easiest for you to learn. They are both good frameworks, so you can't really go wrong. If you know one of the two languages already (python / ruby) then use the language you know.

Things that tipped me in favor of rails:

  1. Beginning Rails 3 [1]. This book is a phenomenal beginners guide to MVC frameworks and Rails. I went from zero to useable programming in one weekend thanks almost entirely to this book.

  2. Railscasts [2]. Good screencasts are hard to come by, and Ryan Bates has created the holy grail of screencast sites dedicated to Rails and all for free. This is a HUGE help in learning a new system.

  3. Heroku [3]. Heroku offers awesome cloud hosting for ruby applications, including rails. Killer features: it's free for small sites, and it works entirely on a GIT workflow.

I would really encourage you to check these resources out. If you can find similar stuff for python and feel like learning Django will be easier and more productive for you, then by all means go that way. For me, the amazing community resources and ease-of-learning made Rails the right choice.

[1] http://rads.stackoverflow.com/amzn/click/1430224339
[2] http://www.railscasts.com
[3] http://www.heroku.com

25
[+5] [2011-03-04 08:40:11] Bashar Abdullah

Few years ago, I tried both, plus Symfony. Symfony was not mature in documentation, and didn't appeal to my taste. A friend who chose Symfony back then is now working to migrate to Rails.

Django was better than Symfony, but at least back then, the documentation wasn't so rich, their admin interface is definitely better than the default Rails scaffold, but their migration was messy and required manual work more than Rails does. Also, Django seemed optimized for news publishing or perhaps blogging. It can set you up quickly with no effort. Rails seemed to me more general.

The community seemed stronger at the time. I'm not following up on Django these days, but Rails is becoming more and more popular with larger crowd.

Also, the huge gem (extension) collection makes it time saving to go Rails. There is also the latest Rails Admin gem, which pretty much seems to fill the missing piece, matching what Django have to offer. Yes it's not by default, but it's few lines of code.

So for me, I tried the three few years back, went with Rails, no regret nor any thought of changing.


26
[+5] [2011-03-18 11:09:51] hmans

There are significant philosophical differences between the underling programming languages, Ruby (Rails) and Python (Django). Because of these, most people love one and hate the other, so your best bet might be simply to try both and stick to the one that clicks first.

The frameworks, Rails and Django, offer roughly the same level of sophistication, so don't worry, you're not going to make a "wrong" choice no matter how you decide.

(For the record, I'm a Rails dude.)


27
[+4] [2008-09-18 12:07:38] Ryan Bigg

I know for a fact there is a great community behind Ruby on Rails ( mailing list, irc channel [1], and at least two [2] forums [3]) and probably an equally greater one behind Django. I agree with Hyposaurus, try both and work out for yourself which one you like.

A Rails server is easy enough to set up, it's just a matter of installing Ruby (which comes with Mac OS X), Rubygems, Rails and optionally the gem called Mongrel, which is a HTTP web server.

Deploying a Rails application is easy enough, with Capistrano or Vlad the Deployer to help you out there and there's plenty of documentation for both programs to help you along the way. Setting up on servers is now easy thanks to Phusion Passenger [4] which has epic documentation also.

I personally prefer coding in Ruby because the language is written to be read by humans primarily, not machines.

Best of luck.

[1] http://groups.google.com/group/rubyonrails-talk
[2] http://ruby-forum.com
[3] http://railsforum.com
[4] http://modrails.com

28
[+4] [2008-09-18 13:37:28] lbz

A lot of PHP developers migrated to Rails successfully (have a look at Rails for PHP Developers [1]).

[1] http://www.pragprog.com/titles/ndphpr/rails-for-php-developers

29
[+4] [2008-09-18 13:45:49] rumblestrut

As mentioned, they're both quite similar. I would suggest finding more about the community for each framework to help you decide.

Is the documentation good? Are great books available? If you post to a forum, are others helpful or condescending?

From my experience, the community and availability of good resources makes all the difference.

My personal preference is Ruby on Rails, but my reason for choosing it over Python and Django was strictly personal. I've heard nothing but nice things about both Rails and Django.


30
[+3] [2010-01-11 04:17:03] PlanetUnknown

My perspective - "Don't try to reinvent the wheel."

Was in your boat about 6 months back. could've gone either ways language/framework wise. Did some research & found google promoting python/dJango big time.

I love clean looking code and also love the speed of development which python gave.

As an engineer you would want to try your hands on both and then pick one, but hey, how much time does that take?

I decided dJango/python since I guess a lot of smart(er) people have spent time at google on this. 8-)

Sticking with it till I hit a wall. Maybe Rails will break the wall at that time 8-)

Best'O'Luck 8-)


Just wondering what "wall" you hit? :) - Torsten
BTW, I'm using web2py on another project, and it rocks !!! way simpler. - PlanetUnknown
31
[+3] [2011-05-29 00:06:58] amit_saxena

This should help you in deciding:
http://www.youtube.com/watch?v=PLUS00QrYWw

Watch out for the other comparisons too... :D
http://www.youtube.com/watch?v=PQbuyKUaKFo


32
[+2] [2008-09-18 12:08:51] Ed.T

You may want to consider if you'll ever want/need to run on the JVM and see what options are available for either framework.


Nowadays both of them can run on JVM - Andrei
33
[+2] [2008-09-18 13:48:38] Chii

It's actually not about learning a particular framework - both is equally good (or bad depending on your point of view). If you have time, do both, and if you dont have time, pick one whose language you are unfamiliar with (so that you learn a new language..hit two birds with one stone as they say).


34
[+1] [2008-09-18 12:01:48] Kyle Cronin

@ Hyposaurus [1]

That is always an option. However, there are aspects I'm curious about that I wouldn't be able to determine for myself without extensive testing, such as scalability. I'm hoping that there are some people here that have tried both and have some observations they can share.

@ DubCee [2]

Why do you prefer coding in Ruby? Do you prefer the syntax, or are there more powerful features that make writing web apps easier or more fun?

[1] #91861
[2] #91874

yes,both.i like the sytntax & some other features that pythons doesn't has: ruby uses scopes like public, private und protected (yes, i also like java ;), ruby has only one listtyp (Array) but you can use it in many different ways (queue,stack,list,set). very usefull for iterating...just 4 example - DeeCee
35
[+1] [2011-03-17 17:09:52] David Stinebeck

Django is kind of a mess. Rails is the easy answers, hands down. I picked it up in a weekend.


(6) Django is well structured if you use it as intended, there is no objective information in this post, you could explain why you feel Django is a mess, or explain features in Rails that you found to make learning it easier. - BiggAl
People do find it messy, see "Why I switched to Pylons after using Django for six months" - Andrei
36