Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Why Python Web Frameworks Are Changing the Web

3,366 views

Published on

An overview and histroy of Python web frameworks, and a discussion of the features of Python that provide for such a strong set of frameworks. Presented at Pycon NZ 2009.

Published in: Technology

Why Python Web Frameworks Are Changing the Web

  1. 1. Why Python Frameworks Are Changing the Web Joel Burton [email_address] Pycon New Zealand 2009
  2. 2. Long, Long Ago...
  3. 3. Avert Your Gaze! <H1><! print $title; !></H1> <UL> <% SELECT name FROM friends %> <LI><! print $name; !></LI> </UL>
  4. 4. “ Beautiful is better than ugly ”
  5. 5. “ Experience is simply the name we give our mistakes ” ― Oscar Wilde
  6. 6. Zope 3 “ Explicit is better than implicit . ”
  7. 7. Grok! “ Although practicality beats purity . ”
  8. 8. “ I’m not a Plone evangelist . I’m a Plone survivor .” ― Chris Calloway ttw rich editing versioning custom content types form generation app dev tools caching systems theming ajax add ons
  9. 9. repoze.bfg “ Do as little as possible , but do it well ! ”
  10. 12. N y e t w o r k s “ It’s so easy to write a web framework in Python, why would you use someone else’s?”
  11. 13. Attribute-Based Templates Zope Page Templates, Genshi, ... <h1 tal:replace =&quot;title&quot; > [title here] </h1> <ul> <li tal:replace =&quot;friend friends&quot; tal:content =&quot;friend/name&quot; > [friend] </li> </ul>
  12. 14. Codelined Templates Mako, Jinja, Cheetah, ... <table> #for $client in $clients <tr> <td> $client.surname, $client.firstname </td> <td> <a href=&quot;mailto: $client.email &quot;> $client.email </a> </td> </tr> #end for </table>
  13. 15. Deliverance <prepend theme=&quot;//head&quot; content=&quot;//head/link&quot; nocontent=&quot;ignore&quot; /> <append-or-replace theme=&quot;//head&quot; content=&quot;//head/title&quot; nocontent=&quot;ignore&quot; /> <copy theme=&quot;//div[@id='container']&quot; content=&quot;//div[@id='region-content']/div[3]&quot; /> * check it out! http://www.coactivate.org/projects/deliverance
  14. 16. URL -> Database? /path/to/folder/in/database
  15. 17. … or take a route? urlpatterns = patterns('', (r'^articles/2003/$', 'news.views.special_case_2003'), (r'^articles/(d{4})/$', 'news.views.year_archive'), (r'^articles/(d{4})/(d{2})/$', 'news.views.month'), (r'^articles/(d{4})/(d{2})/(d+)/$', 'news.views'), )
  16. 18. ZODB
  17. 19. Object-Relational Mappers SQLObject SQLAlchemy ...
  18. 20. “ The Internet is... a series of tubes . ” ― Ted Stevens, US Senator, Alaska WSGI * start here: http://archimedeanco.com/wsgi-tutorial/
  19. 21. do repeat yourself http://pypi.python.org/pypi/zc.buildout apache varnish pound squid supervisor backup
  20. 22. how did we get here?
  21. 23. *security “ PHP isn’t a bad language . It’s just used by bad people .”
  22. 24. CVEs in Last 3 Years http://plone.org/products/plone/security
  23. 25. the results? Powered by Plone
  24. 26. Testing “ Untested code is broken code.” repoze.bfg has 100% test coverage
  25. 27. interfaces & adapters
  26. 28. culture “ Readability counts.”
  27. 29. Conferences Plone Conference, Naples, Italy
  28. 30. Friends in High Places
  29. 31. Componentizing our code Relicensing project Sharing widely with repoze & grok Loving interfaces/adapters Broadening test coverage Integrating AJAX frameworks Innovating in UI concepts
  30. 32. so... what can you do? “ mr. lyle”
  31. 33. … thanks! PyCon New Zealand Tim Knapp The Plone Foundation Chris Calloway Photo Credits: http://www.flickr.com/photos/alf07/ http://www.flickr.com/photos/thetruthabout http://www.flickr.com/photos/chavals http://www.flickr.com/photos/32530713@N08 http://www.flickr.com/photos/caveman_92223 http://www.flickr.com/photos/santos http://www.flickr.com/photos/atomicshed http://www.flickr.com/photos/vidio All images taken by author or from above Creative Commons-licensed works.
  32. 34. Have a great conference & keep in touch: [email_address]

×