As I have been developing Web Applications for just more than an year now, I can safely introduce myself as a Newbie Web Developer. A year ago, when I started out, my first choice when it came to building Web Apps was Ruby on Rails. The reason was the fascination. There was a steep learning curve from my Python background, but it was all worth it.
Today, working in the industry as a Web Programmer, I program applications in both Ruby on Rails and Django. And during my coffee-breaks, when I sit down and retrospect, I start comparing. And when I compare, I come up with advantages and disadvantages of both the web frameworks.
Both Ruby on Rails and Django are no doubt (in my opinion) the two best Web Frameworks in existence. Both have their own bits of Superiority and Inferiority when compared with the other. My talk aims to put these bits in front of the audience and have a little discussion on the areas of improvements.
Presentation on how to chat with PDF using ChatGPT code interpreter
Ruby on Rails versus Django - A newbie Web Developer's Perspective -Shreyank Gupta
1. Introduction
Comparision
Uniqueness
Conclusion
Django v/s Ruby on Rails
A Newbie Web Developer’s Perspective
Shreyank Gupta/shreyankg@fedoraproject.org
March 20, 2010
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
2. Introduction
Comparision First Look
Uniqueness Documentation
Conclusion
Fascination
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
3. Introduction
Comparision First Look
Uniqueness Documentation
Conclusion
From the Website
Ruby on Rails Django
Web Development that doesn’t The Web framework for
hurt perfectionists (with deadlines).
Open-source web Django makes it easier to
development framework build better Web apps more
that’s optimised for quickly and with less code.
programmer’s happiness and Django is a high-level
sustainable productivity. Python Web framework that
Lets you write beautiful encourages rapid
code by favoring convention development and clean,
over configuration. pragmatic design.
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
4. Introduction
Comparision First Look
Uniqueness Documentation
Conclusion
From the Website
Ruby on Rails Django
Web Development that doesn’t The Web framework for
hurt perfectionists (with deadlines).
Open-source web Django makes it easier to
development framework build better Web apps more
that’s optimised for quickly and with less code.
programmer’s happiness and Django is a high-level
sustainable productivity. Python Web framework that
Lets you write beautiful encourages rapid
code by favoring convention development and clean,
over configuration. pragmatic design.
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
5. Introduction
Comparision First Look
Uniqueness Documentation
Conclusion
From the Website
Ruby on Rails Django
Web Development that doesn’t The Web framework for
hurt perfectionists (with deadlines).
Open-source web Django makes it easier to
development framework build better Web apps more
that’s optimised for quickly and with less code.
programmer’s happiness and Django is a high-level
sustainable productivity. Python Web framework that
Lets you write beautiful encourages rapid
code by favoring convention development and clean,
over configuration. pragmatic design.
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
6. Introduction
Comparision First Look
Uniqueness Documentation
Conclusion
From the Website
Ruby on Rails Django
Web Development that doesn’t The Web framework for
hurt perfectionists (with deadlines).
Open-source web Django makes it easier to
development framework build better Web apps more
that’s optimised for quickly and with less code.
programmer’s happiness and Django is a high-level
sustainable productivity. Python Web framework that
Lets you write beautiful encourages rapid
code by favoring convention development and clean,
over configuration. pragmatic design.
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
7. Introduction
Comparision First Look
Uniqueness Documentation
Conclusion
From the Website
Ruby on Rails Django
Web Development that doesn’t The Web framework for
hurt perfectionists (with deadlines).
Open-source web Django makes it easier to
development framework build better Web apps more
that’s optimised for quickly and with less code.
programmer’s happiness and Django is a high-level
sustainable productivity. Python Web framework that
Lets you write beautiful encourages rapid
code by favoring convention development and clean,
over configuration. pragmatic design.
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
11. Introduction
The Rails Way
Comparision
Balance
Uniqueness
Disbalance
Conclusion
Discipline v/s Flexibility
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
12. Introduction
The Rails Way
Comparision
Balance
Uniqueness
Disbalance
Conclusion
The Rails Way
Rails is opinionated software. That is, it assumes that there is a
best way to do things, and its designed to encourage that best way
and in some cases to discourage alternatives. If you learn “The
Rails Way”, you’ll probably discover a tremendous increase in
productivity. If you persist in bringing old habits from other
languages to your Rails development, and trying to use patterns
you learned elsewhere, you may have a less happy experience.
- http://guides.rubyonrails.org/getting started.html
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
13. Introduction
The Rails Way
Comparision
Balance
Uniqueness
Disbalance
Conclusion
The Rails Way
DRY - Dont Repeat Yourself
Writing the same code over and over again is a bad thing.
Convention Over Configuration
Rails makes assumptions about what you want to do and how
you’re going to do it, rather than letting you tweak every little
thing through endless configuration files.
REST
Organizing your application around resources and standard HTTP
verbs is the fastest way to go.
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
14. Introduction
The Rails Way
Comparision
Balance
Uniqueness
Disbalance
Conclusion
The Rails Way
DRY - Dont Repeat Yourself
Writing the same code over and over again is a bad thing.
Convention Over Configuration
Rails makes assumptions about what you want to do and how
you’re going to do it, rather than letting you tweak every little
thing through endless configuration files.
REST
Organizing your application around resources and standard HTTP
verbs is the fastest way to go.
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
15. Introduction
The Rails Way
Comparision
Balance
Uniqueness
Disbalance
Conclusion
The Rails Way
DRY - Dont Repeat Yourself
Writing the same code over and over again is a bad thing.
Convention Over Configuration
Rails makes assumptions about what you want to do and how
you’re going to do it, rather than letting you tweak every little
thing through endless configuration files.
REST
Organizing your application around resources and standard HTTP
verbs is the fastest way to go.
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
16. Introduction
The Rails Way
Comparision
Balance
Uniqueness
Disbalance
Conclusion
Balance
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
17. Introduction
The Rails Way
Comparision
Balance
Uniqueness
Disbalance
Conclusion
Architecture
Ruby on Rails
MVC : Model - Controller - View
versus
Django
MTV : Model - Template - View
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
18. Introduction
The Rails Way
Comparision
Balance
Uniqueness
Disbalance
Conclusion
Architecture
Ruby on Rails
MVC : Model - Controller - View
versus
Django
MTV : Model - Template - View
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
19. Introduction
The Rails Way
Comparision
Balance
Uniqueness
Disbalance
Conclusion
Architecture
Ruby on Rails
MVC : Model - Controller - View
versus
Django
MTV : Model - Template - View
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
20. Introduction
The Rails Way
Comparision
Balance
Uniqueness
Disbalance
Conclusion
Object Relational Mapping - ORM
Ruby on Rails
Active Records
versus
Django
Django Model Instance Reference
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
21. Introduction
The Rails Way
Comparision
Balance
Uniqueness
Disbalance
Conclusion
Object Relational Mapping - ORM
Ruby on Rails
Active Records
versus
Django
Django Model Instance Reference
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
22. Introduction
The Rails Way
Comparision
Balance
Uniqueness
Disbalance
Conclusion
Object Relational Mapping - ORM
Ruby on Rails
Active Records
versus
Django
Django Model Instance Reference
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
23. Introduction
The Rails Way
Comparision
Balance
Uniqueness
Disbalance
Conclusion
Bundled JavaScript
Ruby on Rails
Comes with bundled copies of:
Prototype.js
script.aculo.us
JavaScriptHelper part of the framework.
Django
Ships JQuery as a part of the Admin Interface.
Not a part of the framework.
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
24. Introduction
The Rails Way
Comparision
Balance
Uniqueness
Disbalance
Conclusion
Bundled JavaScript
Ruby on Rails
Comes with bundled copies of:
Prototype.js
script.aculo.us
JavaScriptHelper part of the framework.
Django
Ships JQuery as a part of the Admin Interface.
Not a part of the framework.
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
25. Introduction
The Rails Way
Comparision
Balance
Uniqueness
Disbalance
Conclusion
Bundled JavaScript
Ruby on Rails
Comes with bundled copies of:
Prototype.js
script.aculo.us
JavaScriptHelper part of the framework.
Django
Ships JQuery as a part of the Admin Interface.
Not a part of the framework.
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
26. Introduction
The Rails Way
Comparision
Balance
Uniqueness
Disbalance
Conclusion
Bundled JavaScript
Ruby on Rails
Comes with bundled copies of:
Prototype.js
script.aculo.us
JavaScriptHelper part of the framework.
Django
Ships JQuery as a part of the Admin Interface.
Not a part of the framework.
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
27. Introduction
The Rails Way
Comparision
Balance
Uniqueness
Disbalance
Conclusion
Bundled JavaScript
Ruby on Rails
Comes with bundled copies of:
Prototype.js
script.aculo.us
JavaScriptHelper part of the framework.
Django
Ships JQuery as a part of the Admin Interface.
Not a part of the framework.
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
28. Introduction
The Rails Way
Comparision
Balance
Uniqueness
Disbalance
Conclusion
Bundled JavaScript
Ruby on Rails
Comes with bundled copies of:
Prototype.js
script.aculo.us
JavaScriptHelper part of the framework.
Django
Ships JQuery as a part of the Admin Interface.
Not a part of the framework.
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
29. Introduction
The Rails Way
Comparision
Balance
Uniqueness
Disbalance
Conclusion
Disbalance
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
30. Introduction
The Rails Way
Comparision
Balance
Uniqueness
Disbalance
Conclusion
Views/Templates
Ruby on Rails
Rails Rendering/Layout
versus
Django
Django Templating
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
31. Introduction
The Rails Way
Comparision
Balance
Uniqueness
Disbalance
Conclusion
Views/Templates
Ruby on Rails
Rails Rendering/Layout
versus
Django
Django Templating
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
32. Introduction
The Rails Way
Comparision
Balance
Uniqueness
Disbalance
Conclusion
Views/Templates
Ruby on Rails
Rails Rendering/Layout
versus
Django
Django Templating
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
33. Introduction
The Rails Way
Comparision
Balance
Uniqueness
Disbalance
Conclusion
Directory Structure
Ruby on Rails
$ rails newrails
Django
$ django-admin startproject newdjango
$ cd newdjango
$ python manage.py startapp myapp
Now let’s have a look at the tree.
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
34. Introduction
The Rails Way
Comparision
Balance
Uniqueness
Disbalance
Conclusion
Directory Structure
Ruby on Rails
$ rails newrails
Django
$ django-admin startproject newdjango
$ cd newdjango
$ python manage.py startapp myapp
Now let’s have a look at the tree.
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
35. Introduction
The Rails Way
Comparision
Balance
Uniqueness
Disbalance
Conclusion
Directory Structure
Ruby on Rails
$ rails newrails
Django
$ django-admin startproject newdjango
$ cd newdjango
$ python manage.py startapp myapp
Now let’s have a look at the tree.
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
36. Introduction
The Rails Way
Comparision
Balance
Uniqueness
Disbalance
Conclusion
Authentication Modules
Ruby on Rails
No built-in authentication framework.
Third party authentication plugins available:
Restful Authentication.
Authlogic
Django
Authentication part of the framework.
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
37. Introduction
The Rails Way
Comparision
Balance
Uniqueness
Disbalance
Conclusion
Authentication Modules
Ruby on Rails
No built-in authentication framework.
Third party authentication plugins available:
Restful Authentication.
Authlogic
Django
Authentication part of the framework.
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
38. Introduction
The Rails Way
Comparision
Balance
Uniqueness
Disbalance
Conclusion
Authentication Modules
Ruby on Rails
No built-in authentication framework.
Third party authentication plugins available:
Restful Authentication.
Authlogic
Django
Authentication part of the framework.
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
39. Introduction
The Rails Way
Comparision
Balance
Uniqueness
Disbalance
Conclusion
Authentication Modules
Ruby on Rails
No built-in authentication framework.
Third party authentication plugins available:
Restful Authentication.
Authlogic
Django
Authentication part of the framework.
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
40. Introduction
The Rails Way
Comparision
Balance
Uniqueness
Disbalance
Conclusion
Authentication Modules
Ruby on Rails
No built-in authentication framework.
Third party authentication plugins available:
Restful Authentication.
Authlogic
Django
Authentication part of the framework.
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
41. Introduction
The Rails Way
Comparision
Balance
Uniqueness
Disbalance
Conclusion
Learning curve
Ruby on Rails
Steep Learning Curve
Lots of framework specific stuff to learn
Django
Slight learning curve if you are already familier with Python.
The Django template language ;-)
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
42. Introduction
The Rails Way
Comparision
Balance
Uniqueness
Disbalance
Conclusion
Learning curve
Ruby on Rails
Steep Learning Curve
Lots of framework specific stuff to learn
Django
Slight learning curve if you are already familier with Python.
The Django template language ;-)
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
43. Introduction
The Rails Way
Comparision
Balance
Uniqueness
Disbalance
Conclusion
Learning curve
Ruby on Rails
Steep Learning Curve
Lots of framework specific stuff to learn
Django
Slight learning curve if you are already familier with Python.
The Django template language ;-)
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
44. Introduction
The Rails Way
Comparision
Balance
Uniqueness
Disbalance
Conclusion
Learning curve
Ruby on Rails
Steep Learning Curve
Lots of framework specific stuff to learn
Django
Slight learning curve if you are already familier with Python.
The Django template language ;-)
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
45. Introduction
The Rails Way
Comparision
Balance
Uniqueness
Disbalance
Conclusion
Database Schema Management
Ruby on Rails
$ rake db:migrate
versus
Django
$ python manage.py syncdb
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
46. Introduction
The Rails Way
Comparision
Balance
Uniqueness
Disbalance
Conclusion
Database Schema Management
Ruby on Rails
$ rake db:migrate
versus
Django
$ python manage.py syncdb
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
47. Introduction
The Rails Way
Comparision
Balance
Uniqueness
Disbalance
Conclusion
Database Schema Management
Ruby on Rails
$ rake db:migrate
versus
Django
$ python manage.py syncdb
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
48. Introduction
Comparision Ruby on Rails
Uniqueness Django
Conclusion
Unique (Selling|Breaking) Points
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
49. Introduction
Comparision Ruby on Rails
Uniqueness Django
Conclusion
REST - Representational State Transfer
Using resource identifiers (URLs) to represent resources
Transferring representations of the state of that resource
between system components.
Example
to a Rails application a request such as:
DELETE /photos/17
would be understood to refer to a photo resource with the ID of
17, and to indicate a desired action — deleting that resource.
REST is a natural style for the architecture of web applications,
and Rails makes it even more natural by using conventions to shield
you from some of the RESTful complexities and browser quirks.
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
50. Introduction
Comparision Ruby on Rails
Uniqueness Django
Conclusion
REST - Representational State Transfer
Using resource identifiers (URLs) to represent resources
Transferring representations of the state of that resource
between system components.
Example
to a Rails application a request such as:
DELETE /photos/17
would be understood to refer to a photo resource with the ID of
17, and to indicate a desired action — deleting that resource.
REST is a natural style for the architecture of web applications,
and Rails makes it even more natural by using conventions to shield
you from some of the RESTful complexities and browser quirks.
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
51. Introduction
Comparision Ruby on Rails
Uniqueness Django
Conclusion
Migrations
Definition
Migrations are a convenient way for you to alter your database in a
structured and organised manner. You could edit fragments of SQL by
hand but you would then be responsible for telling other developers that
they need to go and run it. You’d also have to keep track of which changes
need to be run against the production machines next time you deploy.
Proof.
# This file is auto-generated from the current state of the
database. Instead of editing this file,
# please use the migrations feature of Active Record to
incrementally modify your database, and
# then regenerate this schema definition.
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
52. Introduction
Comparision Ruby on Rails
Uniqueness Django
Conclusion
Migrations
Definition
Migrations are a convenient way for you to alter your database in a
structured and organised manner. You could edit fragments of SQL by
hand but you would then be responsible for telling other developers that
they need to go and run it. You’d also have to keep track of which changes
need to be run against the production machines next time you deploy.
Proof.
# This file is auto-generated from the current state of the
database. Instead of editing this file,
# please use the migrations feature of Active Record to
incrementally modify your database, and
# then regenerate this schema definition.
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
53. Introduction
Comparision Ruby on Rails
Uniqueness Django
Conclusion
Rails Scaffold
Definition
Scaffolds an entire resource, from model and migration to
controller and views, along with a full test suite. The resource is
ready to use as a starting point for your RESTful,
resource-oriented application.
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
54. Introduction
Comparision Ruby on Rails
Uniqueness Django
Conclusion
Cross-Reference API
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
55. Introduction
Comparision Ruby on Rails
Uniqueness Django
Conclusion
Django Admin Interface
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
56. Introduction
Comparision Ruby on Rails
Uniqueness Django
Conclusion
Python APIs
Django has the advantage of:
High quality Python APIs available for a lot of services.
Equivalent Ruby APIs not as good quality.
Example
Mark Pilgrim’s Universal Feed Parser v/s rFeedParser
Ruby parser for kickstart issue
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
57. Introduction
Comparision Ruby on Rails
Uniqueness Django
Conclusion
Python APIs
Django has the advantage of:
High quality Python APIs available for a lot of services.
Equivalent Ruby APIs not as good quality.
Example
Mark Pilgrim’s Universal Feed Parser v/s rFeedParser
Ruby parser for kickstart issue
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
58. Introduction
Comparision Ruby on Rails
Uniqueness Django
Conclusion
Python APIs
Django has the advantage of:
High quality Python APIs available for a lot of services.
Equivalent Ruby APIs not as good quality.
Example
Mark Pilgrim’s Universal Feed Parser v/s rFeedParser
Ruby parser for kickstart issue
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
59. Introduction
Comparision Ruby on Rails
Uniqueness Django
Conclusion
Python APIs
Django has the advantage of:
High quality Python APIs available for a lot of services.
Equivalent Ruby APIs not as good quality.
Example
Mark Pilgrim’s Universal Feed Parser v/s rFeedParser
Ruby parser for kickstart issue
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
60. Introduction
Comparision Ruby on Rails
Uniqueness Django
Conclusion
Python APIs
Django has the advantage of:
High quality Python APIs available for a lot of services.
Equivalent Ruby APIs not as good quality.
Example
Mark Pilgrim’s Universal Feed Parser v/s rFeedParser
Ruby parser for kickstart issue
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails
61. Introduction
Comparision Ruby on Rails
Uniqueness Django
Conclusion
The syncdb Drawback
Syncdb will not alter existing tables
syncdb will only create tables for models which have not yet been
installed. It will never issue ALTER TABLE statements to match changes
made to a model class after installation. Changes to model classes and
database schemas often involve some form of ambiguity and, in those
cases, Django would have to guess at the correct changes to make. There
is a risk that critical data would be lost in the process.
If you have made changes to a model and wish to alter the database tables
to match, use the sql command to display the new SQL structure and
compare that to your existing table schema to work out the changes.
- http://docs.djangoproject.com/en/dev/ref/django-admin
Shreyank Gupta/shreyankg@fedoraproject.org Django v/s Ruby on Rails