84
Building Django Jacob Kaplan-Moss PyCon March 29, 2009 http://jacobian.org/speaking/2009/pycon-designing-django/

Building a web framework: Django's design decisions

  • View
    11

  • Download
    0

Embed Size (px)

DESCRIPTION

Since its release three years ago Django’s grown by leaps and bounds; it’s now part of a highly successful new generation of web development tools.However, it hasn’t all been smooth sailing for the Django team. As any Open Source community does, we’ve needed to make a series of tough decisions along the way. These decisions have shaped Django’s internals, public APIs, and community.

Citation preview

Page 1: Building a web framework: Django's design decisions

Building Django

Jacob Kaplan-Moss

PyConMarch 29, 2009

http://jacobian.org/speaking/2009/pycon-designing-django/

Page 2: Building a web framework: Django's design decisions
Page 3: Building a web framework: Django's design decisions

History

Page 4: Building a web framework: Django's design decisions

LJW

Page 5: Building a web framework: Django's design decisions

Adrian/Simon

Page 6: Building a web framework: Django's design decisions

lawrence.com

Great 'cue. Cheapbeer. View.

› All ads thisweek

› This week inDeadwood

› Where to find

Look

Log in topostcomments.

Cornmeal / Hoots & Hellmouth: Steeped inthe tradition of legendary acts, this Chicagoband uses bluegrass as a springboard forlong improvisational work and songs rangingfrom country and rock to jazz and funk ...More info

James Taylor

Deadman Flats / Vegetable

The Spanktones Open Jam

Headlights / OK Jones / The BlessedBroke

All of today's events

National marquee tours

Shows with local bands

Wakarusa 2008› Find photosfrom the festivalhere (new photos

still coming in) and videoposted here. More to be postedas soon as we dry out...

School of Wak (SoggyEdition) (Ten Million Poundsof Sludge)

Wakarusa: Flaming Lips,Bad Camera Policy,Thieving Wookie andMore! (Makes Sense To Me)

How Does It Start? (SinemaParasito)

Unbroleavable storm! (OCaption! My Caption!)

Spinto Band

Great 'cue. Cheapbeer. View.

› All ads thisweek

Log in topostcomments.

Cornmeal / Hoots & Hellmouth: Steeped inthe tradition of legendary acts, this Chicagoband uses bluegrass as a springboard forlong improvisational work and songs rangingfrom country and rock to jazz and funk ...More info

Wakarusa 2008› Find photosfrom the festivalhere (new photos

still coming in) and videoposted here. More to be postedas soon as we dry out...

School of Wak (SoggyEdition) (Ten Million Pounds

Page 7: Building a web framework: Django's design decisions

“The CMS”

Page 8: Building a web framework: Django's design decisions

Philosophy

Page 9: Building a web framework: Django's design decisions

Make development fast

Page 10: Building a web framework: Django's design decisions

Automate repetitive tasks

Page 11: Building a web framework: Django's design decisions

Best practices

Page 12: Building a web framework: Django's design decisions

“”

The ink is never dry on these babies.

— Adrian Holovaty

Page 13: Building a web framework: Django's design decisions

Choices

Page 14: Building a web framework: Django's design decisions

Open Source

Page 15: Building a web framework: Django's design decisions

BSD license

Page 16: Building a web framework: Django's design decisions
Page 17: Building a web framework: Django's design decisions

Pragmatism over Methodology

Page 18: Building a web framework: Django's design decisions

GoF?

MVC?

TDD?

Page 19: Building a web framework: Django's design decisions
Page 20: Building a web framework: Django's design decisions

Snake Oil

Page 21: Building a web framework: Django's design decisions

“”

No silver bullet.

— Fred BrooksAuthor of The Mythical Man-Month

Page 22: Building a web framework: Django's design decisions

The Real World

Page 23: Building a web framework: Django's design decisions

“”

Build cool shit.

— Rob Curley

Page 24: Building a web framework: Django's design decisions

Ramifications

Page 25: Building a web framework: Django's design decisions

“What’s the need?”

Page 26: Building a web framework: Django's design decisions

No architecture astronauts

Page 27: Building a web framework: Django's design decisions

Reinventing the wheel

Page 28: Building a web framework: Django's design decisions

“Magic” over boilerplate

Page 29: Building a web framework: Django's design decisions

Web development is boring

Page 30: Building a web framework: Django's design decisions

It should be fun!

Page 31: Building a web framework: Django's design decisions

not show how they work

APIs should match behavior,

Page 32: Building a web framework: Django's design decisions

Ramifications

Page 33: Building a web framework: Django's design decisions

It can go too far.

Page 34: Building a web framework: Django's design decisions

Messy internals

Page 35: Building a web framework: Django's design decisions

More power in less code

Page 36: Building a web framework: Django's design decisions

Easier to document

Page 37: Building a web framework: Django's design decisions
Page 38: Building a web framework: Django's design decisions

“Full stack”

Page 39: Building a web framework: Django's design decisions

“Best of breed”

Page 40: Building a web framework: Django's design decisions

Why full stack?

Page 41: Building a web framework: Django's design decisions

Lack of choices at the time

Page 42: Building a web framework: Django's design decisions

“Glued together”

Page 43: Building a web framework: Django's design decisions

Ramifications

Page 44: Building a web framework: Django's design decisions

More control

Page 45: Building a web framework: Django's design decisions

Don’t repeat Zope’s mistakes

Page 46: Building a web framework: Django's design decisions

“”

Innovation happens

elsewhere.

— Bill Joy

Page 47: Building a web framework: Django's design decisions

Small pieces advance quicker

Page 48: Building a web framework: Django's design decisions

“Sensible defaults”

Page 49: Building a web framework: Django's design decisions

“Opinionated Software”

Page 50: Building a web framework: Django's design decisions

Ego is dangerous

Page 51: Building a web framework: Django's design decisions

You can’t possibly predict what everyone wants

Page 52: Building a web framework: Django's design decisions

(this is harder than it sounds)... so listen to your users!

Page 53: Building a web framework: Django's design decisions

over “pluggable components”“One obvious way”

Page 54: Building a web framework: Django's design decisions

AutumnModeling

PDBPyORM

SQLAlchemySQLObject

StormZODB

Page 55: Building a web framework: Django's design decisions

Choice is good for experts ...

Page 56: Building a web framework: Django's design decisions

... but not good for new users

Page 57: Building a web framework: Django's design decisions

More beginners

Page 58: Building a web framework: Django's design decisions

“”

Don’t make me think.

— Steve Krug

Page 59: Building a web framework: Django's design decisions

“”

It seems ... that if choice is good, then more choice is better. The paradox is that this “obvious” truth isn’t true... a

point can be reached where, with more choice, people are worse off.

— Barry Schwartz“The Paradox of Choice”

Page 60: Building a web framework: Django's design decisions

Ramifications

Page 61: Building a web framework: Django's design decisions

Consistency

Page 62: Building a web framework: Django's design decisions

Make complicated things easy

Page 63: Building a web framework: Django's design decisions

Don’t reinvent the wheel

Page 64: Building a web framework: Django's design decisions

Set our own pace

Skip to end

Page 65: Building a web framework: Django's design decisions

Choices in the future

Page 66: Building a web framework: Django's design decisions

or huge scale?Long tail

Page 67: Building a web framework: Django's design decisions

#2#5#8

#16#19#20#23

YahooFacebookWikipediaPhotobucketFlickrComcastWordpress

Page 68: Building a web framework: Django's design decisions
Page 69: Building a web framework: Django's design decisions

Sign In Register

Alabama

Alaska

Arizona

Arkansas

California

Colorado

Connecticut

Delaware

Florida

Georgia

Hawaii

Idaho

Illinois

Indiana

Iowa

Kansas

Kentucky

Louisiana

Maine

Maryland

Massachusetts

Michigan

Minnesota

Mississippi

Missouri

Montana

Nebraska

Nevada

New Hampshire

New Jersey

New Mexico

New York

North Carolina

North Dakota

Ohio

Oklahoma

Oregon

Pennsylvania

Rhode Island

South Carolina

South Dakota

Tennessee

Texas

Utah

Vermont

Virginia

Washington

West Virginia

Wisconsin

Wyoming

Standard | Distance | Phone Number

Careers Browse Yellow Pages About YELLOWPAGES.COM Contact Us Site Map Help Advertise With Us

AT&T AT&T Wireless att.net TollFreeDA.com AnyWho Ingenio Yellow Pages Keen

Privacy Policy Terms & Conditions Phone Book Recycling

© 2008 YELLOWPAGES.COM LLC. All rights reserved.

© 2008 AT&T Intellectual Property. All rights reserved. AT&T, AT&T logo and all other marks contained herein are trademarks of AT&T Intellectual Property and/or AT&T affiliated companies.

Some data provided by Localeze and Acxiom.

BROWSE STATES

Atlanta

Austin

Baltimore

Boston

Charlotte

Chicago

Dallas

Denver

Detroit

Houston

Indianapolis

Kansas City

Las Vegas

Los Angeles

Louisville

Memphis

Miami

Milwaukee

New York

Oklahoma City

Orlando

Philadelphia

Phoenix

Saint Louis

San Antonio

San Diego

San Francisco

San Jose

Seattle

More ...

Business Name or Category City, State, ZIP Code or Neighborhood

Set as Default Location

Search Tips

Local Yellow Pages

#643

Page 70: Building a web framework: Django's design decisions

Curse Network Services

Enhance Your Game with Addons!Addons are extensions to games that enhance your gameplay

experience. We have the largest selection of addons. Select a game

to browse addons now! Latest Images

Search WoW Database

World of Warcraft 3,159 Addons

Age of Conan 104 Addons

Warhammer Online 96 Addons

loginWelcome to Curse.

Signup now to take advantage of

amazing Curse.com Features!Curse.com BetaThe new Curse.com site has arrived …

read more

Curse.com Beta Beta Build 8970 Updates

Home News Forums WoW Addons WAR Addons Blogs Images Search:

All Games my Curse Select a Portal

#1295

Page 71: Building a web framework: Django's design decisions

!"#$%$&'()$*+',-.!"#$%&'(&)*+'

Page 72: Building a web framework: Django's design decisions

!"#$%&'&$ ())* +)

Page 73: Building a web framework: Django's design decisions

!"#$%&'&$ ())* +,

Page 74: Building a web framework: Django's design decisions

!"#$%&'&$ ())* +(

Page 75: Building a web framework: Django's design decisions

“Enterprise”

Page 76: Building a web framework: Django's design decisions

Is this a competition we want?

Page 77: Building a web framework: Django's design decisions

Backlash

Page 78: Building a web framework: Django's design decisions

Web Images Maps News Shopping Gmail more !

Web

Sign in

SearchAdvanced SearchPreferences

Results 1 - 10 of about 4,680,000 for rails doesn't scale. (0.09 seconds)

Teflon Ted: Rails Doesn't Scale?Mar 6, 2008 ... "I've heard a few people mention that they heard that Rails doesn't scale[...] any suggestions on how we might alleviate their doubt?" ...trak3r.blogspot.com/2008/03/rails-doesnt-scale.html - 31k - Cached - Similar pages

5 Question Interview with Twitter Developer Alex Payne36 Twitter Admits: Ruby On Rails Can’t Scale at Brandon Werner // Apr 13, ... the rubber ishitting the road, and the thing doesn’t scale on the DB end. ...www.radicalbehavior.com/5-question-interview-with-twitter-developer-alex-payne/ - 161k -Cached - Similar pages

[PDF] “Who said Rails doesn’t Scale?” FeaturesFile Format: PDF/Adobe Acrobat - View as HTML40 to 4000 servers! “Who said Rails doesn’t Scale?” On April 14, 2008, Animoto launcheda Facebook. plugin for their Rails application where users ...www.rightscale.com/pdf/rightscale_rails_web_v1.pdf - Similar pages

I'm Going To Scale My Foot Up Your Ass - Ted DziubaApr 24, 2008 ... After we talk about scalability with our co-workers (Yeah, Rails doesn'tscale!), we flex our true engineering prowess by writing a post ...teddziuba.com/2008/04/im-going-to-scale-my-foot-up-y.html - 11k - Cached - Similar pages

Liminal Existence: ScalabilityMay 11, 2008 ... Regarding frameworks, you're right --- Ruby on Rails doesn't scale, out ofthe box. I've never said otherwise. However, one of Rails ' ...romeda.org/blog/2008/05/scalability.html - 33k - Cached - Similar pages

Terminally Incoherent » Blog Archive » Ruby on Rails doesn’t Scale ...Apr 27, 2007 ... Ruby on Rails doesn’t Scale Well. Ruby is a really great language withsome awesome features, and Rails make it even better. ...

rails doesn't scale

Google

“Rails doesn’t scale”

Page 79: Building a web framework: Django's design decisions

“Django doesn’t ...?”Web Images Maps News Shopping Gmail more !

Web

Sign in

SearchAdvanced SearchPreferences

Results 1 - 10 of about 189 for "django sucks". (0.06 seconds)

Django sucksBad, vile and meaningless: Django sucks from Alan's clob. [RSS] Picture of the blogger ...2006, 5. Django sucks: 21.5 ...www.bel.fi/~alankila/blog/2006/05/21/Django%20sucks.html - 28k - Cached - Similar pages

jQuery compression sucksPre-emphasis: 29.9; Hitman: 7.9. 2006, 8. Misc: 23.8. 2006, 6. DSP progress: 29.6; Blepsynthesis: 19.6; Atari ST audio: 17.6. 2006, 5. Django sucks: 21.5 ...www.bel.fi/~alankila/blog/2007/09/15/jQuery%20compression%20sucks.html - 23k -Cached - Similar pages

Django's SUCKS!!!!! - rec.music | Google GroupsSep 10, 2004 ... Django's SUCKS!!!!! Options ... Subject: Django's SUCKS!!!!! Reply toauthor | Forward | Print | Individual message | Show original | Report ...groups.google.com/group/rec.music/browse_thread/thread/3eed9cda7bd35407/01bc7d127ac14bca - 37k - Cached - Similar pages

Django's SUCKS!!!!! - rec.music | Google GroupsMessage from discussion Django's SUCKS! ... Subject: Django's SUCKS!!!!! Reply toauthor | Forward | Print | View thread | Show original | Report this ...groups.google.com/group/rec.music/msg/01bc7d127ac14bca - 30k - Cached - Similar pages

manicdee: Why Django sucks (and Rails sucks too)The #1 reason why Django sucks is that it doesn't have a graceful means of handlingchanges to the data model. In Ruby on Rails you define the schema in a ...www.livejournal.com/go.bml?journal=manicdee&itemid=35406&dir=prev - 20k -Cached - Similar pages

Twitter / erl: mocking in django sucksTwitter is a free social messaging utility for staying connected in real-time.

"django sucks"

Google

Page 80: Building a web framework: Django's design decisions

Keep out the ego

Page 81: Building a web framework: Django's design decisions

Invite criticism

... and take it well

Page 82: Building a web framework: Django's design decisions

Make conscious decisions

Page 83: Building a web framework: Django's design decisions

Thanks!http://jacobian.org/speaking/2009/pycon-designing-django/

<[email protected]>

Page 84: Building a web framework: Django's design decisions

Photo creditshttp://flickr.com/photos/mawari/2091456761/http://flickr.com/photos/foox404/640768235/http://flickr.com/photos/ppdigital/2327942088/http://flickr.com/photos/summitcheese/197359430/http://flickr.com/photos/kandyjaxx/98984009/http://flickr.com/photos/andih/345556778/http://flickr.com/photos/yuan2003/733770226/http://flickr.com/photos/ocms/2535068094/http://flickr.com/photos/dannyman/958602998/http://flickr.com/photos/martinlabar/2832969149/http://flickr.com/photos/shyha/225517137/http://flickr.com/photos/therefore/19256103/http://flickr.com/photos/teflon/128827389/http://flickr.com/photos/druclimb/390916759/http://flickr.com/photos/cgc/1289366227/http://flickr.com/photos/mihr-i/2741602553/http://flickr.com/photos/wtlphotos/480714473/http://flickr.com/photos/fatboyke/2668411239/http://flickr.com/photos/zen/12132210/http://flickr.com/photos/accordionguy/411908565/http://flickr.com/photos/seier/501372541/http://flickr.com/photos/romanlily/2041441584/http://flickr.com/photos/kookr/2810433787/http://flickr.com/photos/clintjcl/2471735838/http://flickr.com/photos/fynes/72573221/http://flickr.com/photos/thegeneralstore/709924038/http://flickr.com/photos/hamed/231011405/http://flickr.com/photos/fusionpanda/363012235/http://flickr.com/photos/srevenge/1396062019/http://flickr.com/photos/foresmac/2537548732/http://flickr.com/photos/12693492@N04/1338136415/http://flickr.com/photos/platinum/6761199/http://flickr.com/photos/30553515@N00/1786871517/http://flickr.com/photos/skrb/94927584/

Lawrence Journal-World (with permission)Free Software Foundation (GDFL license)Poul-Henning Kamp (Beerware license)NASA (public domain)http://flickr.com/photos/mathoov/19172893/http://flickr.com/photos/trp0/127771914/http://flickr.com/photos/simon/351253/http://flickr.com/photos/number13001/247125164/http://flickr.com/photos/s_v_p/5869861/http://flickr.com/photos/xerones/31671892/http://flickr.com/photos/kt/418938142/http://flickr.com/photos/steffe/154686864/http://flickr.com/photos/8011986@N02/2702162140/http://flickr.com/photos/orinrobertjohn/114430223/http://flickr.com/photos/poluz/1871578378/http://flickr.com/photos/pkdouyk/394163975/http://flickr.com/photos/automatt/226498681/http://flickr.com/photos/micktwomey/9646019/http://flickr.com/photos/twinleaves/437606968/http://flickr.com/photos/mag3737/1914076277/http://flickr.com/photos/beckytwinley/2451754919/http://flickr.com/photos/devos/6358304/http://flickr.com/photos/robyn-gallagher/2097474328/http://flickr.com/photos/lexnger/149433512/http://flickr.com/photos/akearns72/166086716/http://flickr.com/photos/timjoyfamily/532089575/http://flickr.com/photos/pittaya/396707150/http://flickr.com/photos/jcroft/106571677/http://flickr.com/photos/webology/2722802478/http://flickr.com/photos/niallkennedy/310814303/http://flickr.com/photos/thomashawk/305370843/http://flickr.com/photos/glynnis/19523654/http://flickr.com/photos/loredenizen/14435744http://flickr.com/photos/biwook/145765624/http://flickr.com/photos/rspanton/2305408272/http://flickr.com/photos/furiousgeorge81/177926979/http://flickr.com/photos/twenty_questions/2192450204/http://flickr.com/photos/shawnide/1733789973/http://flickr.com/photos/davidrn/255058535/http://flickr.com/photos/eschipul/436109463/http://flickr.com/photos/cguille/2556176764/http://flickr.com/photos/lonebluelady/890604409/http://flickr.com/photos/atomicbartbeans/229618075/http://flickr.com/photos/vidiot/2150088788/http://flickr.com/photos/cboulton/2085336565/http://flickr.com/photos/darwinbell/1538611841/

http://flickr.com/photos/noulakaz/418575599/http://flickr.com/photos/lwr/78032315/http://flickr.com/photos/petereed/496392956/http://flickr.com/photos/ognam/252251866/http://flickr.com/photos/dullhunk/412756798/http://flickr.com/photos/jdlasica/1681114312/http://flickr.com/photos/altemark/304078711/http://flickr.com/photos/mworrell/266913194/http://flickr.com/photos/iainr/61917036/http://flickr.com/photos/dhammza/110422065/http://flickr.com/photos/hercules/118434343/http://flickr.com/photos/donkeycart/2477069275/http://flickr.com/photos/halfbisqued/2353845688/http://flickr.com/photos/dominiqs/137546402/http://flickr.com/photos/articnomad/16153058/http://flickr.com/photos/zrahen/14469412/http://flickr.com/photos/stonebird/2723635311/http://flickr.com/photos/kandyjaxx/2012468692/http://flickr.com/photos/khalid-almasoud/1283997041/http://flickr.com/photos/oskay/404330158/http://flickr.com/photos/cheetleys/295717673/http://flickr.com/photos/gullevek/2667764480/http://flickr.com/photos/phoenixdailyphoto/1467681879/http://flickr.com/photos/gavatron/866650954/http://flickr.com/photos/wheatfields/2587147000/http://flickr.com/photos/locator/420581084/http://flickr.com/photos/tomeppy/84700111/http://flickr.com/photos/bass_nroll/579960238/http://flickr.com/photos/dalbera/2587777300/http://flickr.com/photos/lwr/62382337/http://flickr.com/photos/lwr/526773135/http://flickr.com/photos/lwr/50191251/http://flickr.com/photos/strausser/386412877/http://flickr.com/photos/wolfhound/258498934/http://flickr.com/photos/jef/52133463/http://flickr.com/photos/atc/106694427/http://flickr.com/photos/saintmurse/68159330/http://flickr.com/photos/flattop341/212276640/http://flickr.com/photos/rtarga/223776150/http://flickr.com/photos/xenophod/116388638/http://flickr.com/photos/huladancer22/530743543/http://flickr.com/photos/planetargon/127984254/http://flickr.com/photos/mkmabus/2576358439/http://flickr.com/photos/9619972@N08/2220659880/http://flickr.com/photos/seeminglee/1973003433/