Rails and Django commands : comparison and conversion

by shabda on March 20, 2010

The most commonly used Rails commands and their Django equivalents

Rails Django
rails console manage.py shell
rails server manage.py runserver
rake None
rails generate None
rails dbconsole manage.py dbshell
rails app_name django-admin.py startproject/manage.py startapp
rake db:create manage.py syncdb

The salient points to note are,

  1. Django has all commands via manage.py, Rails has it broken into rails and rake.
  2. Overall there are more Rails+Rake commands available than Django commands
  3. There is no one to one mapping between Rails and Django commands. Eg. There are no equivalent to rake doc:* or rake notes in Django.

Similarly there is no equivalent to manage.py createsuperuser in rails.

References

http://docs.djangoproject.com/en/dev/ref/django-admin/ http://guides.rails.info/command_line.html http://github.com/uswaretech/Acts-as-Django/blob/master/commands.markdown

Related posts:

  1. Django for a Rails Developer
  2. The Rails and Django models layer Rosseta stone

11 Tweets

{ 2 trackbacks }

Review Sites Package – Personal Use – BDN | Definitive Internet Marketing News
March 21, 2010 at 2:54 pm
Review Sites Package – Personal Use – BDN | Twitter Right
March 21, 2010 at 8:52 pm

{ 15 comments… read them below or add one }

1 Alexis Metaireau March 20, 2010 at 9:04 am

Thanks for your article,

Havent you made a mistake with the django “server” command? I think the right command is “runserver” !

Yours,

2 Michael March 20, 2010 at 12:52 pm

All django commands are NOT all in manage.py !

manage.py startproject => that don’t exists

(how can you have a manage.py before the creation of the project?)

3 shabda March 20, 2010 at 1:04 pm

Alexis: Have updated. many thanks. Michael: Thanks! Have updated as well.

I blame Saturday eve rush for these mistakes.

4 Malone Web Development March 23, 2010 at 2:42 am

Thanks for this great article you shared with us. I really like this release.

5 Hotel Software August 17, 2010 at 6:16 am

Thank for the informative article..

Leave a Comment

Additional comments powered by BackType

Previous post:

Next post: