SlideShare una empresa de Scribd logo
1 de 13
Descargar para leer sin conexión
Rails for Django Devs




                 Agiliq.com - Building Amazing Apps
Why?
1. Polyglot-ism is good
2. Not a Django vs Rails tutorial




                                    Agiliq.com - Building Amazing Apps
Why?
1. Rails is an influential framework and many
libraries have been inspired by it. Eg Backbone.
2. Lot of great libraries and knowing rails would
help you port them rather than start from
scratch. Eg we built Django-Merchant after
looking through the API of active merchant.
3. Eg. South, Arel



                                    Agiliq.com - Building Amazing Apps
Good ideas to pick up from Rails
1. Asset Pipeline
2. Better way to write template tags
3. Simplified routing




                                       Agiliq.com - Building Amazing Apps
You say MTV, I say MVC

 app_name/models.py app/models/models_
                    name.rb

 app_name/views.py   app/controllers/contro
                     ller_name.rb
 templates/app_name/ app/views/view_nam
 template.html       e.erb



                               Agiliq.com - Building Amazing Apps
Models
Authoritative Source

app_name/models.py
Database

models.py generate the SQL which is then
applied to DB
Migrations update the DB which is thenn used
to auto-generate schema.rb
                                 Agiliq.com - Building Amazing Apps
Relationships
  models.ForeignKey belongs_to,
                    has_many

  models.           has_one
  OneToOneField
  models.           has_and_belongs_t
  ManyToManyField   o_many



                              Agiliq.com - Building Amazing Apps
Queryset etc
  User.objects.create()      User.create(..)
  user.save()                user.save!
  Model.objects.get(id=10)   Model.find(10)
  Model.objects.filter(..    Model.where(..
  conditions)                conditions)
  Model.objects.order_by     Model.order
  ("created_at")             ("created_at")




                                          Agiliq.com - Building Amazing Apps
Routing



  urls.py       config/routes.rb
  Regex based   DSL based




                         Agiliq.com - Building Amazing Apps
Some More Mappings.

 python manage.py runserver          rails server


 python manage.py shell              rails console



 python manage.py syncdb && python   rake db:create && rake db:migrate
 manage.py migrate




                                                          Agiliq.com - Building Amazing Apps
Things not to learn from Rail
1. Too much autogenerated code
2. Django forms API is much cleaner
3. All models fields are nullable by default




                                     Agiliq.com - Building Amazing Apps
Resources
1. rubyonrails.org
2. guides.rubyonrails.org
3. ruby.railstutorial.org




                            Agiliq.com - Building Amazing Apps
About Agiliq
Python Software consulting company. Small op




                                Agiliq.com - Building Amazing Apps

Más contenido relacionado

La actualidad más candente

React Native - Getting Started
React Native - Getting StartedReact Native - Getting Started
React Native - Getting StartedTracy Lee
 
Building 3D Models with Skycatch & Autodesk Recap API's
Building 3D Models with Skycatch & Autodesk Recap API'sBuilding 3D Models with Skycatch & Autodesk Recap API's
Building 3D Models with Skycatch & Autodesk Recap API'sChristopher Bumgardner
 
Develop Hip APIs and Apps with Spring Boot and Angular - Connect.Tech 2017
 Develop Hip APIs and Apps with Spring Boot and Angular - Connect.Tech 2017 Develop Hip APIs and Apps with Spring Boot and Angular - Connect.Tech 2017
Develop Hip APIs and Apps with Spring Boot and Angular - Connect.Tech 2017Matt Raible
 
Creating BananaJS with Angular 2, Angular CLI, and Material Design
Creating BananaJS with Angular 2, Angular CLI, and Material DesignCreating BananaJS with Angular 2, Angular CLI, and Material Design
Creating BananaJS with Angular 2, Angular CLI, and Material DesignTracy Lee
 
Get Hip with Java Hipster - JavaOne 2017
Get Hip with Java Hipster - JavaOne 2017Get Hip with Java Hipster - JavaOne 2017
Get Hip with Java Hipster - JavaOne 2017Matt Raible
 
Appcelerator Titanium Alloy
Appcelerator Titanium AlloyAppcelerator Titanium Alloy
Appcelerator Titanium AlloyKarthi Ponnusamy
 
The Tale of 2 CLIs - Ember-cli and Angular-cli
The Tale of 2 CLIs - Ember-cli and Angular-cliThe Tale of 2 CLIs - Ember-cli and Angular-cli
The Tale of 2 CLIs - Ember-cli and Angular-cliTracy Lee
 
Angular & rails
Angular & railsAngular & rails
Angular & railsneodynamic
 
Creating an Angular 2 Angular CLI app in 15 Minutes Using MaterializeCSS & Fi...
Creating an Angular 2 Angular CLI app in 15 Minutes Using MaterializeCSS & Fi...Creating an Angular 2 Angular CLI app in 15 Minutes Using MaterializeCSS & Fi...
Creating an Angular 2 Angular CLI app in 15 Minutes Using MaterializeCSS & Fi...Tracy Lee
 
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure FunctionsSharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure FunctionsSébastien Levert
 
Angular2 + Ng-Lightning + Lightning Design System = Great Apps
Angular2 + Ng-Lightning + Lightning Design System = Great AppsAngular2 + Ng-Lightning + Lightning Design System = Great Apps
Angular2 + Ng-Lightning + Lightning Design System = Great AppsEmily Hurn
 
Getting Started with the Angular 2 CLI
Getting Started with the Angular 2 CLIGetting Started with the Angular 2 CLI
Getting Started with the Angular 2 CLIJim Lynch
 
Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017Matt Raible
 
Getting started with Angular CLI
Getting started with Angular CLIGetting started with Angular CLI
Getting started with Angular CLISasha Vinčić
 
Markup Ain't Easy or: How I Learned to love An Object-Oriented RenderAPI
Markup Ain't Easy or: How I Learned to love An Object-Oriented RenderAPIMarkup Ain't Easy or: How I Learned to love An Object-Oriented RenderAPI
Markup Ain't Easy or: How I Learned to love An Object-Oriented RenderAPIc4rl
 
Ember CLI & Ember Tooling
Ember CLI & Ember ToolingEmber CLI & Ember Tooling
Ember CLI & Ember ToolingMark Provan
 
European SharePoint Conference 2017 - SharePoint Framework, Angular & Azure F...
European SharePoint Conference 2017 - SharePoint Framework, Angular & Azure F...European SharePoint Conference 2017 - SharePoint Framework, Angular & Azure F...
European SharePoint Conference 2017 - SharePoint Framework, Angular & Azure F...Sébastien Levert
 

La actualidad más candente (20)

React Native - Getting Started
React Native - Getting StartedReact Native - Getting Started
React Native - Getting Started
 
Building 3D Models with Skycatch & Autodesk Recap API's
Building 3D Models with Skycatch & Autodesk Recap API'sBuilding 3D Models with Skycatch & Autodesk Recap API's
Building 3D Models with Skycatch & Autodesk Recap API's
 
Develop Hip APIs and Apps with Spring Boot and Angular - Connect.Tech 2017
 Develop Hip APIs and Apps with Spring Boot and Angular - Connect.Tech 2017 Develop Hip APIs and Apps with Spring Boot and Angular - Connect.Tech 2017
Develop Hip APIs and Apps with Spring Boot and Angular - Connect.Tech 2017
 
Creating BananaJS with Angular 2, Angular CLI, and Material Design
Creating BananaJS with Angular 2, Angular CLI, and Material DesignCreating BananaJS with Angular 2, Angular CLI, and Material Design
Creating BananaJS with Angular 2, Angular CLI, and Material Design
 
JHipster
JHipsterJHipster
JHipster
 
Get Hip with Java Hipster - JavaOne 2017
Get Hip with Java Hipster - JavaOne 2017Get Hip with Java Hipster - JavaOne 2017
Get Hip with Java Hipster - JavaOne 2017
 
Titanium Alloy Tutorial
Titanium Alloy TutorialTitanium Alloy Tutorial
Titanium Alloy Tutorial
 
Appcelerator Titanium Alloy
Appcelerator Titanium AlloyAppcelerator Titanium Alloy
Appcelerator Titanium Alloy
 
The Tale of 2 CLIs - Ember-cli and Angular-cli
The Tale of 2 CLIs - Ember-cli and Angular-cliThe Tale of 2 CLIs - Ember-cli and Angular-cli
The Tale of 2 CLIs - Ember-cli and Angular-cli
 
Angular & rails
Angular & railsAngular & rails
Angular & rails
 
Apiary
ApiaryApiary
Apiary
 
Creating an Angular 2 Angular CLI app in 15 Minutes Using MaterializeCSS & Fi...
Creating an Angular 2 Angular CLI app in 15 Minutes Using MaterializeCSS & Fi...Creating an Angular 2 Angular CLI app in 15 Minutes Using MaterializeCSS & Fi...
Creating an Angular 2 Angular CLI app in 15 Minutes Using MaterializeCSS & Fi...
 
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure FunctionsSharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
 
Angular2 + Ng-Lightning + Lightning Design System = Great Apps
Angular2 + Ng-Lightning + Lightning Design System = Great AppsAngular2 + Ng-Lightning + Lightning Design System = Great Apps
Angular2 + Ng-Lightning + Lightning Design System = Great Apps
 
Getting Started with the Angular 2 CLI
Getting Started with the Angular 2 CLIGetting Started with the Angular 2 CLI
Getting Started with the Angular 2 CLI
 
Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017
 
Getting started with Angular CLI
Getting started with Angular CLIGetting started with Angular CLI
Getting started with Angular CLI
 
Markup Ain't Easy or: How I Learned to love An Object-Oriented RenderAPI
Markup Ain't Easy or: How I Learned to love An Object-Oriented RenderAPIMarkup Ain't Easy or: How I Learned to love An Object-Oriented RenderAPI
Markup Ain't Easy or: How I Learned to love An Object-Oriented RenderAPI
 
Ember CLI & Ember Tooling
Ember CLI & Ember ToolingEmber CLI & Ember Tooling
Ember CLI & Ember Tooling
 
European SharePoint Conference 2017 - SharePoint Framework, Angular & Azure F...
European SharePoint Conference 2017 - SharePoint Framework, Angular & Azure F...European SharePoint Conference 2017 - SharePoint Framework, Angular & Azure F...
European SharePoint Conference 2017 - SharePoint Framework, Angular & Azure F...
 

Similar a Rails for Django developers

Developing ionic apps for android and ios
Developing ionic apps for android and iosDeveloping ionic apps for android and ios
Developing ionic apps for android and iosgautham_m79
 
Ruby On Rails Basics
Ruby On Rails BasicsRuby On Rails Basics
Ruby On Rails BasicsAmit Solanki
 
Ruby On Rails Seminar Basis Softexpo Feb2010
Ruby On Rails Seminar Basis Softexpo Feb2010Ruby On Rails Seminar Basis Softexpo Feb2010
Ruby On Rails Seminar Basis Softexpo Feb2010arif44
 
Angular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad indiaAngular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad indiaphp2ranjan
 
Ror Seminar With agilebd.org on 23 Jan09
Ror Seminar With agilebd.org on 23 Jan09Ror Seminar With agilebd.org on 23 Jan09
Ror Seminar With agilebd.org on 23 Jan09Shaer Hassan
 
Cross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic FrameworkCross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic FrameworkTroy Miles
 
AngularJS in Production (CTO Forum)
AngularJS in Production (CTO Forum)AngularJS in Production (CTO Forum)
AngularJS in Production (CTO Forum)Alex Ross
 
Ruby Rails Web Development
Ruby Rails Web DevelopmentRuby Rails Web Development
Ruby Rails Web DevelopmentSonia Simi
 
Beginning MEAN Stack
Beginning MEAN StackBeginning MEAN Stack
Beginning MEAN StackRob Davarnia
 
James Jara Portfolio 2014 Part 1
James Jara Portfolio 2014 Part 1James Jara Portfolio 2014 Part 1
James Jara Portfolio 2014 Part 1James Jara
 
Web scraping with BeautifulSoup, LXML, RegEx and Scrapy
Web scraping with BeautifulSoup, LXML, RegEx and ScrapyWeb scraping with BeautifulSoup, LXML, RegEx and Scrapy
Web scraping with BeautifulSoup, LXML, RegEx and ScrapyLITTINRAJAN
 
Angularjs 131211063348-phpapp01
Angularjs 131211063348-phpapp01Angularjs 131211063348-phpapp01
Angularjs 131211063348-phpapp01Arunangsu Sahu
 
Ruby on Rails + AngularJS + Twitter Bootstrap
Ruby on Rails + AngularJS + Twitter BootstrapRuby on Rails + AngularJS + Twitter Bootstrap
Ruby on Rails + AngularJS + Twitter BootstrapMarcio Marinho
 
Angular kickstart slideshare
Angular kickstart   slideshareAngular kickstart   slideshare
Angular kickstart slideshareSaleemMalik52
 

Similar a Rails for Django developers (20)

Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Rails
 
Developing ionic apps for android and ios
Developing ionic apps for android and iosDeveloping ionic apps for android and ios
Developing ionic apps for android and ios
 
Ruby On Rails Basics
Ruby On Rails BasicsRuby On Rails Basics
Ruby On Rails Basics
 
Ruby On Rails Seminar Basis Softexpo Feb2010
Ruby On Rails Seminar Basis Softexpo Feb2010Ruby On Rails Seminar Basis Softexpo Feb2010
Ruby On Rails Seminar Basis Softexpo Feb2010
 
Angular js workshop
Angular js workshopAngular js workshop
Angular js workshop
 
Angular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad indiaAngular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad india
 
Ror Seminar With agilebd.org on 23 Jan09
Ror Seminar With agilebd.org on 23 Jan09Ror Seminar With agilebd.org on 23 Jan09
Ror Seminar With agilebd.org on 23 Jan09
 
Aspose pdf
Aspose pdfAspose pdf
Aspose pdf
 
React django
React djangoReact django
React django
 
Cross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic FrameworkCross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic Framework
 
AngularJS in Production (CTO Forum)
AngularJS in Production (CTO Forum)AngularJS in Production (CTO Forum)
AngularJS in Production (CTO Forum)
 
Ruby Rails Web Development
Ruby Rails Web DevelopmentRuby Rails Web Development
Ruby Rails Web Development
 
Beginning MEAN Stack
Beginning MEAN StackBeginning MEAN Stack
Beginning MEAN Stack
 
James Jara Portfolio 2014 Part 1
James Jara Portfolio 2014 Part 1James Jara Portfolio 2014 Part 1
James Jara Portfolio 2014 Part 1
 
Web scraping with BeautifulSoup, LXML, RegEx and Scrapy
Web scraping with BeautifulSoup, LXML, RegEx and ScrapyWeb scraping with BeautifulSoup, LXML, RegEx and Scrapy
Web scraping with BeautifulSoup, LXML, RegEx and Scrapy
 
AngularJs
AngularJsAngularJs
AngularJs
 
Angularjs 131211063348-phpapp01
Angularjs 131211063348-phpapp01Angularjs 131211063348-phpapp01
Angularjs 131211063348-phpapp01
 
Sst hackathon express
Sst hackathon expressSst hackathon express
Sst hackathon express
 
Ruby on Rails + AngularJS + Twitter Bootstrap
Ruby on Rails + AngularJS + Twitter BootstrapRuby on Rails + AngularJS + Twitter Bootstrap
Ruby on Rails + AngularJS + Twitter Bootstrap
 
Angular kickstart slideshare
Angular kickstart   slideshareAngular kickstart   slideshare
Angular kickstart slideshare
 

Más de Agiliq Info Solutions India Pvt Ltd (6)

Lbs apps-monetization
Lbs apps-monetizationLbs apps-monetization
Lbs apps-monetization
 
Beginning Python
Beginning PythonBeginning Python
Beginning Python
 
Python Metaclass and How Django uses them: Foss 2010
Python Metaclass and How Django uses them: Foss 2010Python Metaclass and How Django uses them: Foss 2010
Python Metaclass and How Django uses them: Foss 2010
 
Django design-patterns
Django design-patternsDjango design-patterns
Django design-patterns
 
The django quiz
The django quizThe django quiz
The django quiz
 
How to launch a startup
How to launch a startupHow to launch a startup
How to launch a startup
 

Rails for Django developers

  • 1. Rails for Django Devs Agiliq.com - Building Amazing Apps
  • 2. Why? 1. Polyglot-ism is good 2. Not a Django vs Rails tutorial Agiliq.com - Building Amazing Apps
  • 3. Why? 1. Rails is an influential framework and many libraries have been inspired by it. Eg Backbone. 2. Lot of great libraries and knowing rails would help you port them rather than start from scratch. Eg we built Django-Merchant after looking through the API of active merchant. 3. Eg. South, Arel Agiliq.com - Building Amazing Apps
  • 4. Good ideas to pick up from Rails 1. Asset Pipeline 2. Better way to write template tags 3. Simplified routing Agiliq.com - Building Amazing Apps
  • 5. You say MTV, I say MVC app_name/models.py app/models/models_ name.rb app_name/views.py app/controllers/contro ller_name.rb templates/app_name/ app/views/view_nam template.html e.erb Agiliq.com - Building Amazing Apps
  • 6. Models Authoritative Source app_name/models.py Database models.py generate the SQL which is then applied to DB Migrations update the DB which is thenn used to auto-generate schema.rb Agiliq.com - Building Amazing Apps
  • 7. Relationships models.ForeignKey belongs_to, has_many models. has_one OneToOneField models. has_and_belongs_t ManyToManyField o_many Agiliq.com - Building Amazing Apps
  • 8. Queryset etc User.objects.create() User.create(..) user.save() user.save! Model.objects.get(id=10) Model.find(10) Model.objects.filter(.. Model.where(.. conditions) conditions) Model.objects.order_by Model.order ("created_at") ("created_at") Agiliq.com - Building Amazing Apps
  • 9. Routing urls.py config/routes.rb Regex based DSL based Agiliq.com - Building Amazing Apps
  • 10. Some More Mappings. python manage.py runserver rails server python manage.py shell rails console python manage.py syncdb && python rake db:create && rake db:migrate manage.py migrate Agiliq.com - Building Amazing Apps
  • 11. Things not to learn from Rail 1. Too much autogenerated code 2. Django forms API is much cleaner 3. All models fields are nullable by default Agiliq.com - Building Amazing Apps
  • 12. Resources 1. rubyonrails.org 2. guides.rubyonrails.org 3. ruby.railstutorial.org Agiliq.com - Building Amazing Apps
  • 13. About Agiliq Python Software consulting company. Small op Agiliq.com - Building Amazing Apps