SlideShare a Scribd company logo
1 of 45
Download to read offline
'   '
django-admin.py startproject mysite


/settings.py

DATABASE_ENGINE = 'mysql'
DATABASE_NAME = 'mysite_db'
DATABASE_USER = 'sergio'
DATABASE_PASSWORD = 'qwerty'
DATABASE_HOST = ''
DATABASE_PORT = ''
rails mysite


/config/database.yml

development:
      adapter: mysql
      encoding: utf8
      database: mysite_db
      username: sergio
      password: qwerty
mysite/
                          mysite/
    __init__.py
                              app/
    manage.py
                                  controllers/
    settings.py
                                  helpers/
    urls.py
                                  models/
                                  views/
                              config/
manage.py startapp blog
                              db/
                              doc/
mysite/
                              lib/
    blog/
                              log/
        __init__.py
                              public/
        models.py
                              script/
        views.py
                              test/
                              tmp/
                              vendor/
/db/schema.rb

ActiveRecord::Schema.define(:version => 0) do
    create_table :posts do |t|
        t.string   :title
        t.text     :description
        t.string   :url
    end
end

/app/models/post.rb

class Post < ActiveRecord::Base
    belongs_to :user
    has_many   :comments
end
/blog/models.py


class Post(models.Model):
    title = models.CharField( max_length=120 )
    description = models.TextField()
    url = models.URLField( verify_exists=True )

   user = models.ForeignKey( User )


class Comment(models.Model):
    ...
   post = models.ForeignKey( Post, related_name=„comments‟)
class AddDetailsToProducts < ActiveRecord::Migration

      def self.up
          add_column :posts, :category, :string
      end

      def self.down
          remove_column :posts, :category
      end
end


rake db:migrate
Class Table Inheritance


class Person(models.Model):
    name = models.CharField( max_length=120 )


class Worker( Person ):
    job = models.CharField( max_length=120 )


class Client( Person ):
   email = models.EmailField()
/urls.py

(r'^blog/(?P<post_id>d+)', blog.views.show_post),



/blog/views.py

def show_post(request, post_id):

    post = get_object_or_404(Post, id=post_id)
    return render_to_response(„blog/post.html',
                              {„post': post})
GENERIC VIEWS

/urls.py

#Url: /blog/123

(r'^blog/(?P<object_id>d+)',
    'django.views.generic.list_detail.object_detail',
    { 'queryset': Post.objects.all() } )



#Template -> blog/post_detail.html
/app/controllers/blog_controller.rb

# URL: /blog/post/123
def post
    @post = Post.find( params[:id] )
end

# Template: /app/views/blog/post.html.erb


/config/routes.rb

#URL: /blog/123
map.connect „blog/:id‟, :controller => „blog‟, :action => „post‟
/app/views/layouts/blog.html.erb

<html><body>
    <h1>
        <%= link_to „Blog‟, :controller => „blog‟ %>
    </h1>
    <%= yield %>
</body></html>


/app/views/blog/create.html.erb

<% form_for :post, @post, :url => {:action => "create”} do |f| %>
    <%= f.text_field :title%>
    <%= f.text_field :description %>
    <%= submit_tag 'Create' %>
<% end %>
/blog/main.html

<html>
    <head>
         <title>
             {% block title %}Blog{% endblock %}
         </title>
    </head>
    <body>
        <h1>
            <a href=“/blog”>Blog</a>
        </h1>
        {% block content %}{% endblock %}
    </body>
</html>
/blog/forms.py

Class PostForm(ModelForm):
    class Meta:
        model = Post


/blog/create.html

{% block title %}Create a new post{% endblock %}

{% block content %}
    <form action="/blog/create" method="POST">
        {{ form.as_ul }}
        <input type="submit" value="Submit" />
    </form>
{% endblock %}
manage.py startapp blog


INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'mysite.blog'
)

urlpatterns = patterns('',

    (r'^blog/', include('mysite.blog.urls')),
)
Rails::Initializer.run do |config|
  config.gem "haml"
  config.gem "chronic", :version => '0.2.3'
  config.gem "hpricot", :source => http://code.whytheluckystiff.net
end



ruby script/plugin install
    http://svn.techno-weenie.net/projects/plugins/restful_authentication/
script/generate controller Blog
      exists app/controllers/
      exists app/helpers/
      create app/views/blog
   > exists test/functional/
   > create test/unit/helpers/
      create app/controllers/blog_controller.rb
   > create test/functional/blog_controller_test.rb
      create app/helpers/blog_helper.rb
   > create test/unit/helpers/blog_helper_test.rb




Rspec, cucumber, shoulda, mocha, webrat...
Doctests
def my_func(a_list, index):
    """
    >>> a = ['larry', 'curly', 'moe']
    >>> my_func(a, 0)
    'larry'
    >>> my_func(a, 1)
    'curly'
    """
    return a_list[index]



Unit Tests
class MyFuncTestCase(unittest.TestCase):
    def testBasic(self):
        a = ['larry', 'curly', 'moe']
        self.assertEquals(my_func(a, 0), 'larry')
        self.assertEquals(my_func(a, 1), 'curly')
Guides.rubyonrails.orgWorking With Rails
• Web applications for information management
• Reusable components
• Common functionalities built-in
  - Authentication
  - Authorization (permissions)
  - Image or file upload
  ...
•   Less common web applications
•   AJAX intensive
•   Dedicated hosting and support
•   Heavy testing
•   Specialized tools
Content

• http://superjared.com/entry/rails-versus-django/

• http://wiki.alcidesfonseca.com/rails-vs-django/

• http://www.scribd.com/doc/121814/RailsDjango-Comparison

• http://docs.google.com/View?docid=dcn8282p_1hg4sr9

• http://www.magpiebrain.com/blog/2005/08/14/a-
comparison-of-django-with-rails/
Photos

•   Title - http://www.flickr.com/photos/dunechaser/2936384537/
•   Introduction - http://www.flickr.com/photos/dunechaser/2630433944/
•   Disclaimer - http://www.flickr.com/photos/jazamarripae/1936251344/
•   Frameworks Background - http://www.flickr.com/photos/albaum/430677776/
•   Initial configuration - http://www.flickr.com/photos/somethingstartedcrazyy/1352607255/
•   Structure - http://www.flickr.com/photos/9160678@N06/578966742/
•   Database & Models - http://www.flickr.com/photos/shindotv/3835365695/
•   Controllers/Views - http://www.flickr.com/photos/p1r/633300342/
•   Views/Templates - http://www.flickr.com/photos/gigi62/3092670031/
•   Administration - http://www.flickr.com/photos/fotopakismo/1183485780/
•   Extensibility - http://www.flickr.com/photos/grdloizaga/817443503/
•   Testing - http://www.flickr.com/photos/telstar/422117665/
•   Communities - http://www.flickr.com/photos/pugetive/506788681/
•   Conclusions - http://www.flickr.com/photos/argenberg/188043461/
•   Sources - http://www.flickr.com/photos/quarenta/2876309035/
Django Vs Rails

More Related Content

What's hot

Ruby on Rails : RESTful 和 Ajax
Ruby on Rails : RESTful 和 AjaxRuby on Rails : RESTful 和 Ajax
Ruby on Rails : RESTful 和 Ajax
Wen-Tien Chang
 
Dependency Management with RequireJS
Dependency Management with RequireJSDependency Management with RequireJS
Dependency Management with RequireJS
Aaronius
 
Render API - Pavel Makhrinsky
Render API - Pavel MakhrinskyRender API - Pavel Makhrinsky
Render API - Pavel Makhrinsky
DrupalCampDN
 
Dundee University HackU 2013 - Mojito
Dundee University HackU 2013 - MojitoDundee University HackU 2013 - Mojito
Dundee University HackU 2013 - Mojito
smartads
 
Javascript MVC & Backbone Tips & Tricks
Javascript MVC & Backbone Tips & TricksJavascript MVC & Backbone Tips & Tricks
Javascript MVC & Backbone Tips & Tricks
Hjörtur Hilmarsson
 
Rails Routing and URL design
Rails Routing and URL designRails Routing and URL design
Rails Routing and URL design
hiq5
 

What's hot (20)

DJango admin interface
DJango admin interfaceDJango admin interface
DJango admin interface
 
AngularJS vs. Ember.js vs. Backbone.js
AngularJS vs. Ember.js vs. Backbone.jsAngularJS vs. Ember.js vs. Backbone.js
AngularJS vs. Ember.js vs. Backbone.js
 
Андрей Юртаев - Improve theming with (Twitter) Bootstrap
Андрей Юртаев - Improve theming with (Twitter) BootstrapАндрей Юртаев - Improve theming with (Twitter) Bootstrap
Андрей Юртаев - Improve theming with (Twitter) Bootstrap
 
实战Ecos
实战Ecos实战Ecos
实战Ecos
 
ui-router and $state
ui-router and $stateui-router and $state
ui-router and $state
 
WordPress Theme Design and Development Workshop - Day 3
WordPress Theme Design and Development Workshop - Day 3WordPress Theme Design and Development Workshop - Day 3
WordPress Theme Design and Development Workshop - Day 3
 
Django class based views for beginners
Django class based views for beginnersDjango class based views for beginners
Django class based views for beginners
 
Drupal Development
Drupal DevelopmentDrupal Development
Drupal Development
 
2007 Fsoss Drupal Under The Hood
2007 Fsoss Drupal Under The Hood2007 Fsoss Drupal Under The Hood
2007 Fsoss Drupal Under The Hood
 
Drupal Javascript for developers
Drupal Javascript for developersDrupal Javascript for developers
Drupal Javascript for developers
 
Ruby on Rails : RESTful 和 Ajax
Ruby on Rails : RESTful 和 AjaxRuby on Rails : RESTful 和 Ajax
Ruby on Rails : RESTful 和 Ajax
 
Dependency Management with RequireJS
Dependency Management with RequireJSDependency Management with RequireJS
Dependency Management with RequireJS
 
WordCamp Montreal 2015: Combining Custom Post Types, Fields, and Meta Boxes t...
WordCamp Montreal 2015: Combining Custom Post Types, Fields, and Meta Boxes t...WordCamp Montreal 2015: Combining Custom Post Types, Fields, and Meta Boxes t...
WordCamp Montreal 2015: Combining Custom Post Types, Fields, and Meta Boxes t...
 
Get AngularJS Started!
Get AngularJS Started!Get AngularJS Started!
Get AngularJS Started!
 
Render API - Pavel Makhrinsky
Render API - Pavel MakhrinskyRender API - Pavel Makhrinsky
Render API - Pavel Makhrinsky
 
Ui router
Ui routerUi router
Ui router
 
Dundee University HackU 2013 - Mojito
Dundee University HackU 2013 - MojitoDundee University HackU 2013 - Mojito
Dundee University HackU 2013 - Mojito
 
Javascript MVC & Backbone Tips & Tricks
Javascript MVC & Backbone Tips & TricksJavascript MVC & Backbone Tips & Tricks
Javascript MVC & Backbone Tips & Tricks
 
Drupal 7 — Circle theme
Drupal 7 — Circle themeDrupal 7 — Circle theme
Drupal 7 — Circle theme
 
Rails Routing and URL design
Rails Routing and URL designRails Routing and URL design
Rails Routing and URL design
 

Similar to Django Vs Rails

Gae Meets Django
Gae Meets DjangoGae Meets Django
Gae Meets Django
fool2nd
 
TurboGears2 Pluggable Applications
TurboGears2 Pluggable ApplicationsTurboGears2 Pluggable Applications
TurboGears2 Pluggable Applications
Alessandro Molina
 
Intro to Pylons / Pyramid
Intro to Pylons / PyramidIntro to Pylons / Pyramid
Intro to Pylons / Pyramid
Eric Paxton
 
Rails 3 overview
Rails 3 overviewRails 3 overview
Rails 3 overview
Yehuda Katz
 
Django Class-based views (Slovenian)
Django Class-based views (Slovenian)Django Class-based views (Slovenian)
Django Class-based views (Slovenian)
Luka Zakrajšek
 

Similar to Django Vs Rails (20)

Gae Meets Django
Gae Meets DjangoGae Meets Django
Gae Meets Django
 
Django
DjangoDjango
Django
 
The Rails Way
The Rails WayThe Rails Way
The Rails Way
 
TurboGears2 Pluggable Applications
TurboGears2 Pluggable ApplicationsTurboGears2 Pluggable Applications
TurboGears2 Pluggable Applications
 
WordPress plugin #3
WordPress plugin #3WordPress plugin #3
WordPress plugin #3
 
Django
DjangoDjango
Django
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to Django
 
Flask – Python
Flask – PythonFlask – Python
Flask – Python
 
Django Heresies
Django HeresiesDjango Heresies
Django Heresies
 
Intro to Pylons / Pyramid
Intro to Pylons / PyramidIntro to Pylons / Pyramid
Intro to Pylons / Pyramid
 
Rails 3 overview
Rails 3 overviewRails 3 overview
Rails 3 overview
 
Django Class-based views (Slovenian)
Django Class-based views (Slovenian)Django Class-based views (Slovenian)
Django Class-based views (Slovenian)
 
Django Rest Framework and React and Redux, Oh My!
Django Rest Framework and React and Redux, Oh My!Django Rest Framework and React and Redux, Oh My!
Django Rest Framework and React and Redux, Oh My!
 
Django for Beginners
Django for BeginnersDjango for Beginners
Django for Beginners
 
Introduction Django
Introduction DjangoIntroduction Django
Introduction Django
 
PHPConf-TW 2012 # Twig
PHPConf-TW 2012 # TwigPHPConf-TW 2012 # Twig
PHPConf-TW 2012 # Twig
 
What's new in Django 1.2?
What's new in Django 1.2?What's new in Django 1.2?
What's new in Django 1.2?
 
Mojolicious
MojoliciousMojolicious
Mojolicious
 
Using Geeklog as a Web Application Framework
Using Geeklog as a Web Application FrameworkUsing Geeklog as a Web Application Framework
Using Geeklog as a Web Application Framework
 
WordPress Structure and Best Practices
WordPress Structure and Best PracticesWordPress Structure and Best Practices
WordPress Structure and Best Practices
 

More from Sérgio Santos

More from Sérgio Santos (9)

Launching tech products
Launching tech productsLaunching tech products
Launching tech products
 
Simple MongoDB design for Rails apps
Simple MongoDB design for Rails appsSimple MongoDB design for Rails apps
Simple MongoDB design for Rails apps
 
Rails + mongo db
Rails + mongo dbRails + mongo db
Rails + mongo db
 
Ultra fast web development with sinatra
Ultra fast web development with sinatraUltra fast web development with sinatra
Ultra fast web development with sinatra
 
Agoge - produtividade & multitasking
Agoge - produtividade & multitaskingAgoge - produtividade & multitasking
Agoge - produtividade & multitasking
 
Ontologias
OntologiasOntologias
Ontologias
 
Workshop Django
Workshop DjangoWorkshop Django
Workshop Django
 
Gestão De Projectos
Gestão De ProjectosGestão De Projectos
Gestão De Projectos
 
Gestor - Casos De Uso
Gestor - Casos De UsoGestor - Casos De Uso
Gestor - Casos De Uso
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

Django Vs Rails

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8. ' '
  • 9.
  • 10. django-admin.py startproject mysite /settings.py DATABASE_ENGINE = 'mysql' DATABASE_NAME = 'mysite_db' DATABASE_USER = 'sergio' DATABASE_PASSWORD = 'qwerty' DATABASE_HOST = '' DATABASE_PORT = ''
  • 11. rails mysite /config/database.yml development: adapter: mysql encoding: utf8 database: mysite_db username: sergio password: qwerty
  • 12.
  • 13. mysite/ mysite/ __init__.py app/ manage.py controllers/ settings.py helpers/ urls.py models/ views/ config/ manage.py startapp blog db/ doc/ mysite/ lib/ blog/ log/ __init__.py public/ models.py script/ views.py test/ tmp/ vendor/
  • 14.
  • 15. /db/schema.rb ActiveRecord::Schema.define(:version => 0) do create_table :posts do |t| t.string :title t.text :description t.string :url end end /app/models/post.rb class Post < ActiveRecord::Base belongs_to :user has_many :comments end
  • 16. /blog/models.py class Post(models.Model): title = models.CharField( max_length=120 ) description = models.TextField() url = models.URLField( verify_exists=True ) user = models.ForeignKey( User ) class Comment(models.Model): ... post = models.ForeignKey( Post, related_name=„comments‟)
  • 17. class AddDetailsToProducts < ActiveRecord::Migration def self.up add_column :posts, :category, :string end def self.down remove_column :posts, :category end end rake db:migrate
  • 18. Class Table Inheritance class Person(models.Model): name = models.CharField( max_length=120 ) class Worker( Person ): job = models.CharField( max_length=120 ) class Client( Person ): email = models.EmailField()
  • 19.
  • 20. /urls.py (r'^blog/(?P<post_id>d+)', blog.views.show_post), /blog/views.py def show_post(request, post_id): post = get_object_or_404(Post, id=post_id) return render_to_response(„blog/post.html', {„post': post})
  • 21. GENERIC VIEWS /urls.py #Url: /blog/123 (r'^blog/(?P<object_id>d+)', 'django.views.generic.list_detail.object_detail', { 'queryset': Post.objects.all() } ) #Template -> blog/post_detail.html
  • 22. /app/controllers/blog_controller.rb # URL: /blog/post/123 def post @post = Post.find( params[:id] ) end # Template: /app/views/blog/post.html.erb /config/routes.rb #URL: /blog/123 map.connect „blog/:id‟, :controller => „blog‟, :action => „post‟
  • 23.
  • 24. /app/views/layouts/blog.html.erb <html><body> <h1> <%= link_to „Blog‟, :controller => „blog‟ %> </h1> <%= yield %> </body></html> /app/views/blog/create.html.erb <% form_for :post, @post, :url => {:action => "create”} do |f| %> <%= f.text_field :title%> <%= f.text_field :description %> <%= submit_tag 'Create' %> <% end %>
  • 25. /blog/main.html <html> <head> <title> {% block title %}Blog{% endblock %} </title> </head> <body> <h1> <a href=“/blog”>Blog</a> </h1> {% block content %}{% endblock %} </body> </html>
  • 26. /blog/forms.py Class PostForm(ModelForm): class Meta: model = Post /blog/create.html {% block title %}Create a new post{% endblock %} {% block content %} <form action="/blog/create" method="POST"> {{ form.as_ul }} <input type="submit" value="Submit" /> </form> {% endblock %}
  • 27.
  • 28.
  • 29.
  • 30.
  • 31. manage.py startapp blog INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'mysite.blog' ) urlpatterns = patterns('', (r'^blog/', include('mysite.blog.urls')), )
  • 32. Rails::Initializer.run do |config| config.gem "haml" config.gem "chronic", :version => '0.2.3' config.gem "hpricot", :source => http://code.whytheluckystiff.net end ruby script/plugin install http://svn.techno-weenie.net/projects/plugins/restful_authentication/
  • 33.
  • 34. script/generate controller Blog exists app/controllers/ exists app/helpers/ create app/views/blog > exists test/functional/ > create test/unit/helpers/ create app/controllers/blog_controller.rb > create test/functional/blog_controller_test.rb create app/helpers/blog_helper.rb > create test/unit/helpers/blog_helper_test.rb Rspec, cucumber, shoulda, mocha, webrat...
  • 35. Doctests def my_func(a_list, index): """ >>> a = ['larry', 'curly', 'moe'] >>> my_func(a, 0) 'larry' >>> my_func(a, 1) 'curly' """ return a_list[index] Unit Tests class MyFuncTestCase(unittest.TestCase): def testBasic(self): a = ['larry', 'curly', 'moe'] self.assertEquals(my_func(a, 0), 'larry') self.assertEquals(my_func(a, 1), 'curly')
  • 36.
  • 38.
  • 39.
  • 40. • Web applications for information management • Reusable components • Common functionalities built-in - Authentication - Authorization (permissions) - Image or file upload ...
  • 41. Less common web applications • AJAX intensive • Dedicated hosting and support • Heavy testing • Specialized tools
  • 42.
  • 43. Content • http://superjared.com/entry/rails-versus-django/ • http://wiki.alcidesfonseca.com/rails-vs-django/ • http://www.scribd.com/doc/121814/RailsDjango-Comparison • http://docs.google.com/View?docid=dcn8282p_1hg4sr9 • http://www.magpiebrain.com/blog/2005/08/14/a- comparison-of-django-with-rails/
  • 44. Photos • Title - http://www.flickr.com/photos/dunechaser/2936384537/ • Introduction - http://www.flickr.com/photos/dunechaser/2630433944/ • Disclaimer - http://www.flickr.com/photos/jazamarripae/1936251344/ • Frameworks Background - http://www.flickr.com/photos/albaum/430677776/ • Initial configuration - http://www.flickr.com/photos/somethingstartedcrazyy/1352607255/ • Structure - http://www.flickr.com/photos/9160678@N06/578966742/ • Database & Models - http://www.flickr.com/photos/shindotv/3835365695/ • Controllers/Views - http://www.flickr.com/photos/p1r/633300342/ • Views/Templates - http://www.flickr.com/photos/gigi62/3092670031/ • Administration - http://www.flickr.com/photos/fotopakismo/1183485780/ • Extensibility - http://www.flickr.com/photos/grdloizaga/817443503/ • Testing - http://www.flickr.com/photos/telstar/422117665/ • Communities - http://www.flickr.com/photos/pugetive/506788681/ • Conclusions - http://www.flickr.com/photos/argenberg/188043461/ • Sources - http://www.flickr.com/photos/quarenta/2876309035/