Download pdf - 10 Reasons to try Django

Transcript
Page 1: 10 Reasons to try Django

10 Reasons why you should try Django

Keir Whitaker - Carsonified

BathCamp 2008

Page 2: 10 Reasons to try Django

History• Django is a high-level Python Web framework that encourages rapid

development and clean, pragmatic design

• Open sourced in 2005

• Roots in online news production in Lawrence Kansas USA

• In September 2008 Django 1.0 was released

• First DjangoCon took place at Google offices in Mountain View

• Great community around the project

• It’s opinionated but not as opinionated as some frameworks

Page 3: 10 Reasons to try Django

Background• My background is in PHP, ASP.Net, MySQL, SQL Server

• I am relatively new to Python and Django, so no hard questions please

• I have tried most frameworks and Django is the one I like most

• Carsonified used Django to build MATT (http://www.themattinator.com)

• <plug>please vote for MATT in the .net awards</plug>

Page 4: 10 Reasons to try Django

#1: Easy Install•Python and SQLite are pre installed on OSX

•Windows installer is available

•No extras required

Page 5: 10 Reasons to try Django

#2: Great docs•Documentation re-factor for 1.0

•Very well written and easy to follow

•“Writing your first Django application” tutorial

Page 6: 10 Reasons to try Django
Page 7: 10 Reasons to try Django

#3: Configuration•Configuration over Convention

•Complete control over URL structure

•Loose coupling

Page 8: 10 Reasons to try Django

#4: Modelling•Data models are defined in Python code

•No need to know any SQL

•Flexible ORM enables you to achieve a lot

•Can always fall back on SQL when needed

Page 9: 10 Reasons to try Django

#5: Generic Views•Views for list/detail interfaces

•Views for year/month/day archive pages

•Views for detail and “latest” pages

•Views for creating, editing, and deleting objects

Page 10: 10 Reasons to try Django

#6: Admin App•Production ready admin app bundled

•It’s not scaffolding

•Easy to customise

•Enables client data to be entered up front

Page 11: 10 Reasons to try Django
Page 12: 10 Reasons to try Django

#7: Templating•Template inheritance

•Shallow learning curve for “interface ninjas”

•Tags and filters to control flow and presentation

•Easy to extend with your own tags and filters

Page 13: 10 Reasons to try Django

#8: Pluggable•Easy to install distributed Django apps

•Easy to integrate Python modules

•Most uses cases have a Google Code project

•Plug and play in most cases

Page 14: 10 Reasons to try Django
Page 15: 10 Reasons to try Django

#9: Forms•Flexible form generation

•Customisable validation rules

•Auto generated XHTML form widgets

•Create forms based on your models

Page 16: 10 Reasons to try Django

#10: Deployment•Apache with mod_python

•Can deploy on shared hosting

•WebFaction and Media Temple offer Django

•WebFaction promo code: CARSONDJANGO

Page 17: 10 Reasons to try Django

Summary1. Easy Installation

2. Great documentation

3. Configuration over convention

4. Models are defined in Python

5. Generic views

6. Admin app

7. Flexible templating

8. Pluggable architecture (projects and apps)

9. Form handling

10. Deployment

Page 18: 10 Reasons to try Django

[email protected]

@keirwhitaker

http://www.fiveandlime.com

http://www.slideshare.com/keirwhitaker