Skip to content

Latest commit

 

History

History
37 lines (22 loc) · 2 KB

ror-to-django.md

File metadata and controls

37 lines (22 loc) · 2 KB

Ruby on Rails vs. Django

In general, Django is more bare-bones than Ruby on Rails. It has fewer features, but is highly automated in a few areas. Certain things, (the database and the admin interface), Django creates automagically, making it very hard to customize. However, it makes up for that with it's modularity; it should be completely customizable if one is willing to swap out components.

Similarities

Many things are similar, but have different names and work slightly differently:

Ruby on Rails Django
ActiveRecord "database abstraction API"
Router URLConf; manually maps url strings to python functions, found in urls.py
transactions; ActiveRecord::Base.transaction transactions;'@transaction.atomic`

Differences

No DB Migrations

Ruby on Rails has database migrations for managing and changing the database. It gives you a lot of control at the database level.

Django automatically generates tables base on your models. To make major changes to the table structure, you have to drop the tables and start over.

Seriously.

There is a library called South that may help with this; it seems to implement Rails-like functionality for managing the Django database.

Simpler Routing

The Django URLConf is much simpler than the Rails Router: it doesn't autogenerate resourceful routes, or nested routes. You must hand-craft a python regex for each url. (You can automate nesting somewhat by including other URLConfs in the top-level URLConf.)