Django - the first five years
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
No Downloads

Views

Total Views
5,923
On Slideshare
5,901
From Embeds
22
Number of Embeds
7

Actions

Shares
Downloads
75
Comments
1
Likes
4

Embeds 22

http://softwarelibre.org.bo 9
http://www.softwarelibre.org.bo 4
http://www.slideshare.net 3
http://xsmolina.blogspot.com 2
http://www.techgig.com 2
http://www.tumblr.com 1
http://denklab.tumblr.com 1

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. The first five years Jacob Kaplan-Moss Google, December 16, 2008 http://jacobian.org/speaking/2008/first-five-years/
  • 2. “ Good software takes ten years. Get used to it. — Joel Spolsky ” http://www.joelonsoftware.com/articles/fog0000000017.html
  • 3. Halfway there! http://flickr.com/photos/usonian/257403571/
  • 4. Kansas
  • 5. Merry Slickmas Events Latest Music Movies Food Nightlife Best bets Upcoming quot;A Benefit for Charley's Fingerquot; with The Dactyls / Naomi What? Charlie Downey is a baller. He's so badass that he broke his finger in two places when one of his shots got stuffed Today at 10:00pm The Jackpot Music Hall, $5 Today's events Search events Staph blogs O Caption! My Caption! The Dog and Pony Show Loafers of Mass Destruction 13 comments Hark! The Local Musicians Sing!: New Christmas albums from Sam Billen and Josh Atkinson Scene Stealers Sam Billen’s “Merry Christmas” and Josh Atkinson’s “Songs for Christmas” rank right up 'Synecdoche, New York' tackles life’s there with recent yuletide blessings from Sufjan Stevens and Low. Both albums strip away complexity with complexity
  • 6. “ In the beginning there was Zope. Zope was a web application framework ... but it had some discontents who dared to call it quot;monolithicquot; and quot;unpythonicquot;. And behold, then there came Webware, and it was Modular.... But others rebelled ... and a Ton of frameworks appeared: Quixote ... SkunkWEB ... ” CherryPy ... and some thirteen others. — Mike Orr http://linuxgazette.net/113/orr.html
  • 7. 2003
  • 8. 2008
  • 9. r36 cms/apps/polls/ r84 cms/core/validators.py r159 cms/core/paginator.py r327 cms/apps/auth/ r390 cms/core/urlresolvers.py r630 cms/core/sites.py
  • 10. February 2004 circa r1000
  • 11. cms/apps/polls/poll.py
  • 12. >>>
from
cms.apps.polls.polls
import
Poll >>>
p
=
Poll(4,
quot;hiquot;,
date(2004,
1,
1),
...) >>>
p.save()
  • 13. cms/apps/polls/polls.py
  • 14. cms/apps/polls/polls.py
  • 15. cms/apps/polls/dblayout.sql
  • 16. httpd.conf
  • 17. cms/conf/mrmustard/polls.py
  • 18. cms/views/polls/polls.py
  • 19. Data class Admin view Data-access function(s) Admin template Admin URLs
  • 20. cms/datadescriptions/polls.py
  • 21. ./generate_code.py
polls
  • 22. apps/ polls.py sql/ polls.sql views/ admin/ polls.py templates/ admin/ polls/ change_list.html add_form.html change_form.html
  • 23. cms/utilities/codegeneration/generation.py
  • 24. cms/datadescriptions/polls.py
  • 25. DO
NOT
EDIT
THIS
FILE
MANUALLY. IT
WAS
GENERATED
BY
A
PROGRAM. RE‐RUN
THE
CODE
GENERATOR
INSTEAD.
  • 26. Seven months later... October 2004
  • 27. cms/models/polls.py
  • 28. PyCon 2005
  • 29. Rails
  • 30. class
Poll(meta.Model): 



fields
=
( 







meta.SlugField('slug',
'slug',
unique_for_month='pub_dat 







meta.CharField('question',
'question',
maxlength=255), 







meta.DateTimeField('pub_date',
'date
published'), 







meta.DateTimeField('expire_date',
'expiration
date'), 







meta.ManyToManyField(core.Site), 







meta.PositiveSmallIntegerField('choice_votes',
'choice
v 



) 



db_table
=
polls 



ordering
=
('‐pub_date',) 



get_latest_by
=
'pub_date'
  • 31. class
Poll(meta.Model): 



slug
=
meta.SlugField(unique_for_month='pub_date') 



question
=
meta.CharField(maxlength=255) 



pub_date
=
meta.DateTimeField('date
published') 



expire_date
=
meta.DateTimeField('expiration
date') 



sites
=
meta.ManyToManyField(core.Site) 



choice_votes
=
meta.PositiveSmallIntegerField(default=1) 



class
META: 







db_table
=
'polls' 







ordering
=
('‐pub_date',)
  • 32. “ I can't think of any other backwards-incompatible changes that we're planning before 1.0 (knock on wood). If this isn't the last one, though, it's at least the last major one. — Adrian, August 2005 ” http://www.djangoproject.com/weblog/2005/aug/25/modelsyntax/
  • 33. Before: from
django.models.polls
import
Poll After: from
myapp.models
import
Poll
  • 34. Before: ...
magic!
... After: import
datetime
  • 35. Before: class
Poll(meta.Model): 



class
META: 







admin
=
meta.Admin( 











list_display
=
('title'), 







) After: class
Poll(meta.Model): 



class
Admin 







list_display
=
('title')
  • 36. Before: from
django.models.polls
import
polls polls.get_list(slug__exact='slug') After: from
polls.models
import
Poll Poll.objects.filter(slug='slug')
  • 37. 
339
files
changed,
 22290
insertions(+),
 15656
deletions(‐)
  • 38. “ After this merge, Django 1.0 can’t be far off. — Bill de hÓra ” http://www.dehora.net/journal/2006/04/django_magic_merging.html
  • 39. “0.95”
  • 40. django.newforms django.test
  • 41. 18 months
  • 42. 3,094 commits + branches
  • 43. 1,370 from the community
  • 44. 230 new AUTHORS
  • 45. 2,120 bugs fixed
  • 46. 
1,394
files
changed,
 28,3237
insertions(+),
 97,036
deletions(‐)
  • 47. 40,000 lines of new documentation
  • 48. 4 new full committers
  • 49. Unicode
  • 50. QSRF
  • 51. NFA
  • 52. GeoDjango
  • 53. ModelForms
  • 54. Autoescaping
  • 55. Django on Jython (Thanks, Google!)
  • 56. ... and much more ... http://docs.djangoproject.com/en/dev/releases/1.0/
  • 57. API stability & forwards-compatability http://docs.djangoproject.com/en/dev/misc/api-stability/
  • 58. Formal release process http://docs.djangoproject.com/en/dev/internals/release-process/
  • 59. What’s next?
  • 60. Django 1.1 March 16, 2009
  • 61. Django 1.1 Roadmap http://code.djangoproject.com/wiki/Version1.1Roadmap
  • 62. ORM aggregation http://github.com/freakboy3742/django/tree/aggregation
  • 63. >>>
Book.objects.aggregate( ...




Avg('price'), ...




highest_price
=
Max('price')) {'price_avg':
45.0,
'highest_price':
82.80}
  • 64. >>>
Author.objects.aggregate(Sum('book__price')) {'book_price_sum':
442}
  • 65. >>>
books
=
Book.objects.annotate(Max('authors__age')) >>>
books[0].name u'Python
Web
Development
With
Django' >>>
books[0].authors.all() [<Author:
Jeffrey
Forcier
>,
<Author:
Paul
Bissex>,
 <Author:
Wesley
J.
Chun>] >>>
books[0].authors__age__max 37.0
  • 66. Publisher.objects.annotate(num_books=Count('book__id'))
 
















.filter(num_books__gt=1)
 
















.order_by('num_books')
  • 67. Improved QuerySet.update()
  • 68. >>>
Person.objects.update(age=F('age')+1)
  • 69. Model Validation http://code.djangoproject.com/ticket/6845
  • 70. >>>
p
=
Person.objects.get(...) >>>
p.age
=
‐7 >>>
p.save(validate=True) Traceback
(most
recent
call
last): 

File
quot;<stdin>quot;,
line
1,
in
<module> ValidationError:
enter
a
number
greater
than
0.
  • 71. Bulk admin actions http://code.google.com/p/django-batchadmin/
  • 72. Class-based generic views
  • 73. from
django.views.generic
import
DetailView class
PersonView(DetailView): 



queryset
=
Person.objects.all() 



 



def
get_template(self,
request): 







return
Template(...)
  • 74. ... and more ... http://code.djangoproject.com/wiki/Version1.1Roadmap
  • 75. Please help! http://code.djangoproject.com/wiki/Version1.1Roadmap#how-you-can-help
  • 76. Thank you! jacob@jacobian.org