C4ainaction-Introduction to the Pyramid Web Framework


Published on

Pyramid is a Python web framework and it is so awesome. If you are looking to choose a web framework written in Python, you should consider choosing Pyramid. It is flexible and it so doesn't get in your way during the development of your application.

It is highly pluggable, take what you need and ignore what you don't. A lot of choices are left to be made by you because you know the requirements of your software better.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

C4ainaction-Introduction to the Pyramid Web Framework

  1. 1. print “About Me”Francis Addai (amoeba),Student at KNUSTtwitter: @faddaiemail: 4addai@gmail.comblog: http://faddai.tumblr.com
  2. 2. Overview✔ What is Pyramid?✔ Pyramid vs. Other Frameworks✔ The Community & Resources✔ Geekry!Demo & Questions
  3. 3. What is Pyramid● An open source web framework ● Easier to create arbitrary web apps ● Can be used to build wide array of applications ● Simple Blogs, CMS, Social Web Apps...etc
  4. 4. What makes Pyramid Awesome● Pyramid is a fast and flexible web framework● Beats similar web frameworks in many performance metrics● Component Architecture● More choices and flexibility● Learn from and contribute back to the Pylons Community
  5. 5. Brief History Well, sadly enough I hate history Pylons + Repoze.bfg
  6. 6. Brief History● Pylons,TurboGears, Django(2005-)● Repoze.bfg (2008-2010) ● Influenced by Zope* (1998?-)● Pylons, Repoze.bfg, TG merge into The Pylons Project (2010)● A collection of web related Python projects under a single umbrella● Pylons development discontinued● Repoze.bfg renamed to Pyramid● Pyramid currently the main web framework
  7. 7. Getting started● $ virtualenv env● $ cd env● $ source bin/activate● $ easy-install pyramid [nose]● $ pcreate -s starter HelloWorld
  8. 8. Your first Web Application
  9. 9. The Pyramid Tenets ● Simplicity ● Minimalism ● Documentation ● Reliability ● Openness ● Speed *https://www.pylonsproject.org/projects/pyramid/about
  10. 10. Simplicity"Only pay for what you eat"  ● Not forced to user any particular technology ● No DB ● SQL ● MongoDBAll okayEasy to set up basic apps
  11. 11. MinimalismRelatively small code base (~5000 lines)Django ~60,000 lines Concentrates on common core activities: ● URL mapping, ● templating, ● security, ● serving static assets
  12. 12. DocumentationEvery aspect of the framework is documented  ● Coverage is good, but sometimes lacks good  examples ● Improving over time ● You can learn by examples too on github, clone  and just hack away. https://docs.pylonsproject.org/
  13. 13. Reliability ● Tested exhaustively ● 100% code test coverage ● “If it ain’t tested, it’s broke" ● Source code has good examples of well written tests Unit testing is very important.
  14. 14. Openness"As with Python, the Pyramid software is distributedunder a permissive open source license."  ● Active community ● Main developers Chris McDonough, Ben Bangert, and others respond to question frequently ● Growing library of open source pyramid related projects
  15. 15. SpeedCore functionality is optimized for very fast execution ● Hardware maybe cheap these day ● The time and energy needed to manage all that  hardware is not so cheap 
  16. 16. Two methods of routing requestsURL Dispatch ● Simple pattern matching ● Maps a view function to a URL patternTraversal ● Analogous to opening a file/directory in your OSs file system ● Stick with URL Dispatch if youre a beginner Templating Engine ● Chameleon and Mako support ● I prefer Makos syntax 
  17. 17. CommunityCommunity Contributions  ● Pyramid projects on Github ● Best way to learn (other than documentation) Many pyramid_* packages and continuing to grow Google Grouphttp://groups.google.com/group/pylons-discussIRC: #pylons on Freenode