SlideShare a Scribd company logo
1 of 45
Download to read offline
The goodies that
Zope begat
Pyramid, Plone, buildout + more
Dylan Jay @djay75
Who am I?
Dylan Jay
Core Plone Contributor
1995 First web app (ISAPI)
1999 Built first e-commerce
site (zope)
2003 Built first startup
(IntroVino)
2004 Started
PretaWeb/PretaGov (Plone0
Reasons for this talk
History
"Those who don't learn from history are
doomed to add it as a feature of their
framework"
Better choices
There is no perfect framework, only a perfect mess when you pick
wrong
Reuse
The goodies
1. Traversal
2. ZODB
3. ZTK Adapters
4. Sprints
5. Pyramid
6. Buildout
7. Plone + the customisation cliff
8. Diazo
9. RobotFramework - RobotSuite
Python family tree(web)
Zope (1996-)
ZTK (BlueBream)
(2004-)
Pylons/TurboGears
(2005-2010)Django (2005-)
Flask (2010-)
RoR (2004-) Plone (1999-)
BFG (2008-2010)
CGI (1993-)
httpd (1990-)
NikolaPyramid (2010-)
Zope - wtf was that about?
Back in 1996
● webserver = path to file
● cgi = path to script + args
● OO - was very big
● Jim Fulton was on a
plane
traversal = path to object + '/' + method
zope = zope object publishing environment
Goodie #1 - Traversal
response = traverse(root, HTTP_PATH.split('/'), request)
def traverse(context, path, request):
if len(path) == 0:
return context(request)
elif len(path) == 1:
view_method = getattr( context, path[0] )
return view_method(request)
else:
sub_context = context[ path[0] ]
return traverse( sub_context, path[1:], request)
Traversal - why?
Good for CMS
plugins cooperating
webapps
complex apps
TraversalRoutes
/A/B/C/myaction/myaction/id123
distributedcentrally defined
Good for relational
single use apps
Goodie #2: ZODB
● Want to store something non relational?
● Want to store something non key-value?
● Got complex object structures?
Use Object persistence
ZODB: The piss easy DB
$ easyinstall ZODB
db = DB( FileStorage.FileStorage('./Data.fs') )
connection = db.open()
dbroot = connection.root()
transaction.commit()
db.close()
dbroot['a_number'] = 3
dbroot['a_string'] = 'Gift'
dbroot['a_list'] = [1, 2, 3, 5, 7, 12]
dbroot['a_dictionary'] = { 1918: 'Red Sox', 1919: 'Reds' }
dbroot['deeply_nested'] = {
1918: [ ('Red Sox', 4), ('Cubs', 2) ],
1919: [ ('Reds', 5), ('White Sox', 3) ],
}
ZODB: simple but powerful
● transactions - multiversion concurrency
control (MVCC)
● scalability across a network (using ZEO)
● replication (using ZRS or relstorage)
● history/undo
● transparently pluggable storage
● built-in caching
● Blob support
Goodie #3: Adapters
Adapters: why?
● Solves how to plug complex software
together
● Better than Object Orientation
● Perfect for overridable software
● Perfect for plugin architecture
● ZTK - ZCA - Zope3 == Adapters
ZTK Adapters
class IUSPlug(zope.interface):
prongs = Attribute("""number of prongs""")
class Motox(object):
implements(IUSPlug)
prongs = 2
class INZPlug(zope.interface):
prongs = Attribute("""number of prongs""")
ZTK Adapters
class ACPowerAdapter(object):
implements(INZPlug)
adapts(IUSPlug)
def __init__(self, plug):
self.prongs = plug.prongs + 1
self.voltage = 240
registry.registerAdapter(ACPowerAdapter)
ZTK Adapters
>>> myphone = MotoX()
>>> myphone.prongs == 3
False
>>> adaptedphone = INZPlug(myphone)
>>> adaptedphone.prongs == 3
True
Goodie #4: Sprints
“The practice of using sprints for open source
software development was pioneered by the
Zope Corporation in the early days of the Zope
3 project. Between January 2002 and January
2006, more than 30 Zope 3 sprints had taken
place.[citation needed]”
Plone Pacific Rim Sprint 14-15 Sept
Goodie #5 Pyramid
Zope (1996-)
ZTK (BlueBream)
(2004-)
Pylons/TurboGears
(2005-2010)Django (2005-)
Flask (2010-)
RoR (2004-) Plone (1999-)
BFG (2008-2010)
CGI (1993-)
httpd (1990-)
NikolaPyramid (2010-)
Pyramid: It's micro!
from wsgiref.simple_server import make_server
from pyramid.view import view_config
from pyramid.config import Configurator
if __name__ == '__main__':
config = Configurator()
config.add_route('hello', '/hello/{name}')
config.scan()
app = config.make_wsgi_app()
server = make_server('0.0.0.0', 8080, app)
server.serve_forever()
@view_config(route_name='hello', renderer='json')
def hello_world(request):
return {'content':'Hello %(name)s!' % request.matchdict}
Pyramid: worst name ever
Pyramid (the structure) Pyramid (the framework)
Start big - End small Start small - End big
Ancient Best of breed
Unchanging over time Extensible & Flexible
Pyramid: a "micro & more"
Framework
● a declarative authorization system
● extensibility: aggregate Pyramid application
configuration from multiple sources
● separate I18N translation string factories
● reuse: "Interface" based view/subscriber
registrations
● optionally map URLs to code using traversal
Pyramid: routes vs.
traversal: why not both?
from wsgiref.simple_server import make_server
from pyramid.config import Configurator
from pyramid.response import Response
class Resource(dict):
pass
def get_root(request):
return Resource({'a': Resource({'b': Resource({'c': Resource()})})})
def hello_world_of_resources(context, request):
output = "Here's a resource and its children: %s" % context
return Response(output)
if __name__ == '__main__':
config = Configurator(root_factory=get_root)
config.add_view(hello_world_of_resources, context=Resource)
app = config.make_wsgi_app()
server = make_server('0.0.0.0', 8080, app)
server.serve_forever()
Goodie #6: buildout
buildout - what you get if you put make, puppet,
python, pip, virtualenv into a blender
Buildout
● uses recipes - python packages that know
how to build other things
○ like puppet
● automated dependencies
○ like Make
● recipes download and install python
packages into your environment
○ like PIP/easy_install
● everything gets installed into a local directory
isolated from your system
○ like virtualenv
Buildout is like...
you need it when
- you’re on tour (deploy different places)
- very different components
Goodie #7: Plone
300+ core contributors
400+ plugins
1000+ commits/month
5-8 sprints per year
1 Plone foundation
1-2 CVE's/year
Plone
Plone step 1: Install
wget --no-check-certificate https://launchpad.
net/plone/4.3/4.3.1/+download/Plone-4.3.1-
UnifiedInstaller.tgz
# Extract the downloaded file
tar -xf Plone-4.3-UnifiedInstaller.tgz
# Go the folder containing installer script
cd Plone-4.3-UnifiedInstaller
# Run script
./install.sh standalone
cd ~/Plone/zinstance
bin/instance fg
Plone: #2 Add content
Plone Step 2: Add content
Plone Step 3: Add plugins
$ nano buildout.cfg
[instance]
...
eggs =
Products.PloneFormGen
collective.recaptcha
$ bin/buildout
$ bin/instance fg
Plone Step 4: Theme it
Framework vs CMS
start with a blank page start with fully featured site
build up customise down
good for "app" sites good for "content" sites others can edit
Framework CMS
startup tool agency tool
risk reinventing the wheel risk hitting customisation cliff
dev has full control shared control, editors, admin, dev, themer
Content Editor Site Admin
Separation of concerns
Backend devFrontend dev /
Themer
Integrator
Reviewer
Developers blog
Integrator
Static site generator
An app/startup
Backend devFrontend dev / Themer
Django/Pyramid
Simple Blog
Content Editor
PluginsThemes
Simple CMS e.g. Wordpress
Large content site
PluginsThemes
Frontend dev /
Themer
Content Editor Site Admin
Integrator
Reviewer
Enterprise CMS
Web consultancy
Plugins
Frontend dev /
Themer
Content Editor
Site Admin
Integrator CMS/Framework
The customisation cliff
Framework
CMS
Goodie #8: Diazo
- Ultimate in code - html seperation
- templates without altering your html
- allows designer to work on html while you
work on the code - round trip
Diazo.org
1. app with very simple html
- "content"
2. create mockups in html of
how you want the pages to
really look - "theme"
3. create a rules.xml.
4. Compile it to single XSLT
file,
5. execute it in middleware
Goodie #9:
RobotFramework
what you get when you put python, selenum
and BDD into a blender
RobotFramework
RobotFramework
● Not invented by Plone/Zope (Nokia did)
● but robotsuite was
● Used to test Plone
● Automated screenshots for user manuals
Thanks
Dylan Jay (pretagov.com.au)

More Related Content

What's hot

Web development automatisation for fun and profit (Artem Daniliants)
Web development automatisation for fun and profit (Artem Daniliants)Web development automatisation for fun and profit (Artem Daniliants)
Web development automatisation for fun and profit (Artem Daniliants)
LumoSpark
 
Write your first WordPress plugin
Write your first WordPress pluginWrite your first WordPress plugin
Write your first WordPress plugin
Anthony Montalbano
 
Advanced WordPress Development Environments
Advanced WordPress Development EnvironmentsAdvanced WordPress Development Environments
Advanced WordPress Development Environments
Beau Lebens
 
Scrip queue tree
Scrip queue treeScrip queue tree
Scrip queue tree
Marco Arias
 

What's hot (20)

Bower - A package manager for the web
Bower - A package manager for the webBower - A package manager for the web
Bower - A package manager for the web
 
WordPress Performance optimization
WordPress Performance optimizationWordPress Performance optimization
WordPress Performance optimization
 
Cool like a Frontend Developer: Grunt, RequireJS, Bower and other Tools
Cool like a Frontend Developer: Grunt, RequireJS, Bower and other ToolsCool like a Frontend Developer: Grunt, RequireJS, Bower and other Tools
Cool like a Frontend Developer: Grunt, RequireJS, Bower and other Tools
 
wp-cli
wp-cliwp-cli
wp-cli
 
WordPress mit Composer und Git verwalten
WordPress mit Composer und Git verwaltenWordPress mit Composer und Git verwalten
WordPress mit Composer und Git verwalten
 
HTTPS + Let's Encrypt
HTTPS + Let's EncryptHTTPS + Let's Encrypt
HTTPS + Let's Encrypt
 
Fast Paced Drupal 8: Accelerating Development with Composer, Drupal Console a...
Fast Paced Drupal 8: Accelerating Development with Composer, Drupal Console a...Fast Paced Drupal 8: Accelerating Development with Composer, Drupal Console a...
Fast Paced Drupal 8: Accelerating Development with Composer, Drupal Console a...
 
Html5 intro
Html5 introHtml5 intro
Html5 intro
 
WordPress Structure and Best Practices
WordPress Structure and Best PracticesWordPress Structure and Best Practices
WordPress Structure and Best Practices
 
Web development automatisation for fun and profit (Artem Daniliants)
Web development automatisation for fun and profit (Artem Daniliants)Web development automatisation for fun and profit (Artem Daniliants)
Web development automatisation for fun and profit (Artem Daniliants)
 
Mehr Performance für WordPress - WordCamp Köln
Mehr Performance für WordPress - WordCamp KölnMehr Performance für WordPress - WordCamp Köln
Mehr Performance für WordPress - WordCamp Köln
 
PHP SA 2014 - Releasing Your Open Source Project
PHP SA 2014 - Releasing Your Open Source ProjectPHP SA 2014 - Releasing Your Open Source Project
PHP SA 2014 - Releasing Your Open Source Project
 
Mastering Grunt
Mastering GruntMastering Grunt
Mastering Grunt
 
Write your first WordPress plugin
Write your first WordPress pluginWrite your first WordPress plugin
Write your first WordPress plugin
 
The wp config.php
The wp config.phpThe wp config.php
The wp config.php
 
Contributing to WordPress Core - Peter Wilson
Contributing to WordPress Core - Peter WilsonContributing to WordPress Core - Peter Wilson
Contributing to WordPress Core - Peter Wilson
 
Phing i Fabric - Budowanie i deployment aplikacji webowych
Phing i Fabric - Budowanie i deployment aplikacji webowychPhing i Fabric - Budowanie i deployment aplikacji webowych
Phing i Fabric - Budowanie i deployment aplikacji webowych
 
Ako na vlastne WP temy
Ako na vlastne WP temyAko na vlastne WP temy
Ako na vlastne WP temy
 
Advanced WordPress Development Environments
Advanced WordPress Development EnvironmentsAdvanced WordPress Development Environments
Advanced WordPress Development Environments
 
Scrip queue tree
Scrip queue treeScrip queue tree
Scrip queue tree
 

Viewers also liked

Kim Lankshear portfolio
Kim Lankshear portfolioKim Lankshear portfolio
Kim Lankshear portfolio
Kim Lankshear
 
Catalogo de productos Opinat
Catalogo de productos OpinatCatalogo de productos Opinat
Catalogo de productos Opinat
sraventos
 
Sitios de internet que utilizan el comercio electronico como herramienta prin...
Sitios de internet que utilizan el comercio electronico como herramienta prin...Sitios de internet que utilizan el comercio electronico como herramienta prin...
Sitios de internet que utilizan el comercio electronico como herramienta prin...
Guuz Medrano
 
Tallerpaja
TallerpajaTallerpaja
Tallerpaja
fbaselga
 
Agenda kundentag2010
Agenda kundentag2010Agenda kundentag2010
Agenda kundentag2010
boluser
 
30 sessions web. Síntesis EN
30 sessions web. Síntesis EN30 sessions web. Síntesis EN
30 sessions web. Síntesis EN
gencat .
 
Plan estratégico concepto
Plan estratégico conceptoPlan estratégico concepto
Plan estratégico concepto
xavier1603
 

Viewers also liked (20)

5 things STILL! TOO! HARD! in Plone 5
5 things STILL! TOO! HARD! in Plone 55 things STILL! TOO! HARD! in Plone 5
5 things STILL! TOO! HARD! in Plone 5
 
VRR-Resume
VRR-ResumeVRR-Resume
VRR-Resume
 
¿Preparado para el 15 de enero?
¿Preparado para el 15 de enero?¿Preparado para el 15 de enero?
¿Preparado para el 15 de enero?
 
Circuitos eléctricos
Circuitos eléctricosCircuitos eléctricos
Circuitos eléctricos
 
Networking Fundamentals
Networking FundamentalsNetworking Fundamentals
Networking Fundamentals
 
PLE
PLEPLE
PLE
 
Kim Lankshear portfolio
Kim Lankshear portfolioKim Lankshear portfolio
Kim Lankshear portfolio
 
Catalogo de productos Opinat
Catalogo de productos OpinatCatalogo de productos Opinat
Catalogo de productos Opinat
 
Sitios de internet que utilizan el comercio electronico como herramienta prin...
Sitios de internet que utilizan el comercio electronico como herramienta prin...Sitios de internet que utilizan el comercio electronico como herramienta prin...
Sitios de internet que utilizan el comercio electronico como herramienta prin...
 
Mg54 imagina + (negocios digialtes)
Mg54 imagina + (negocios digialtes)Mg54 imagina + (negocios digialtes)
Mg54 imagina + (negocios digialtes)
 
Jim Kaskade Biography
Jim Kaskade BiographyJim Kaskade Biography
Jim Kaskade Biography
 
Tallerpaja
TallerpajaTallerpaja
Tallerpaja
 
Fiestas populares de españa kevin bustamante
Fiestas populares de españa kevin bustamanteFiestas populares de españa kevin bustamante
Fiestas populares de españa kevin bustamante
 
Nachhaltigkeit Sinn Werte und CSR in Unternehmen
Nachhaltigkeit Sinn Werte und CSR in UnternehmenNachhaltigkeit Sinn Werte und CSR in Unternehmen
Nachhaltigkeit Sinn Werte und CSR in Unternehmen
 
Revista huilloz 2013
Revista huilloz 2013Revista huilloz 2013
Revista huilloz 2013
 
Agenda kundentag2010
Agenda kundentag2010Agenda kundentag2010
Agenda kundentag2010
 
30 sessions web. Síntesis EN
30 sessions web. Síntesis EN30 sessions web. Síntesis EN
30 sessions web. Síntesis EN
 
Revista aprendespanol num2
Revista aprendespanol num2Revista aprendespanol num2
Revista aprendespanol num2
 
Plan estratégico concepto
Plan estratégico conceptoPlan estratégico concepto
Plan estratégico concepto
 
Gsec corporate presentation 0315
Gsec corporate presentation 0315Gsec corporate presentation 0315
Gsec corporate presentation 0315
 

Similar to The goodies of zope, pyramid, and plone (2)

Porting Rails Apps to High Availability Systems
Porting Rails Apps to High Availability SystemsPorting Rails Apps to High Availability Systems
Porting Rails Apps to High Availability Systems
Marcelo Pinheiro
 
Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01
Tony Frame
 

Similar to The goodies of zope, pyramid, and plone (2) (20)

web2py:Web development like a boss
web2py:Web development like a bossweb2py:Web development like a boss
web2py:Web development like a boss
 
Pres Db2 native rest json and z/OS connect
Pres Db2 native rest json and z/OS connect Pres Db2 native rest json and z/OS connect
Pres Db2 native rest json and z/OS connect
 
Web Components With Rails
Web Components With RailsWeb Components With Rails
Web Components With Rails
 
Cloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Cloud meets Fog & Puppet A Story of Version Controlled InfrastructureCloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Cloud meets Fog & Puppet A Story of Version Controlled Infrastructure
 
Porting legacy apps to Griffon
Porting legacy apps to GriffonPorting legacy apps to Griffon
Porting legacy apps to Griffon
 
Plugin-based software design with Ruby and RubyGems
Plugin-based software design with Ruby and RubyGemsPlugin-based software design with Ruby and RubyGems
Plugin-based software design with Ruby and RubyGems
 
Implementing New Web
Implementing New WebImplementing New Web
Implementing New Web
 
Implementing new WebAPIs
Implementing new WebAPIsImplementing new WebAPIs
Implementing new WebAPIs
 
Porting Rails Apps to High Availability Systems
Porting Rails Apps to High Availability SystemsPorting Rails Apps to High Availability Systems
Porting Rails Apps to High Availability Systems
 
Node azure
Node azureNode azure
Node azure
 
Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01
 
node.js: Javascript's in your backend
node.js: Javascript's in your backendnode.js: Javascript's in your backend
node.js: Javascript's in your backend
 
London HUG 12/4
London HUG 12/4London HUG 12/4
London HUG 12/4
 
Python at Facebook
Python at FacebookPython at Facebook
Python at Facebook
 
Headless Drupal en pratique
Headless Drupal en pratiqueHeadless Drupal en pratique
Headless Drupal en pratique
 
Hopping in clouds: a tale of migration from one cloud provider to another
Hopping in clouds: a tale of migration from one cloud provider to anotherHopping in clouds: a tale of migration from one cloud provider to another
Hopping in clouds: a tale of migration from one cloud provider to another
 
Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013
 
Creating a modern web application using Symfony API Platform, ReactJS and Red...
Creating a modern web application using Symfony API Platform, ReactJS and Red...Creating a modern web application using Symfony API Platform, ReactJS and Red...
Creating a modern web application using Symfony API Platform, ReactJS and Red...
 
FP - Découverte de Play Framework Scala
FP - Découverte de Play Framework ScalaFP - Découverte de Play Framework Scala
FP - Découverte de Play Framework Scala
 
Building native Android applications with Mirah and Pindah
Building native Android applications with Mirah and PindahBuilding native Android applications with Mirah and Pindah
Building native Android applications with Mirah and Pindah
 

More from Dylan Jay

Surviving an earthquake's worth of traffic
Surviving an earthquake's worth of trafficSurviving an earthquake's worth of traffic
Surviving an earthquake's worth of traffic
Dylan Jay
 

More from Dylan Jay (7)

Surviving an earthquake's worth of traffic
Surviving an earthquake's worth of trafficSurviving an earthquake's worth of traffic
Surviving an earthquake's worth of traffic
 
Buildout: How to maintain big app stacks without losing your mind
Buildout: How to maintain big app stacks without losing your mindBuildout: How to maintain big app stacks without losing your mind
Buildout: How to maintain big app stacks without losing your mind
 
Opps I deployed it again-ploneconf2010
Opps I deployed it again-ploneconf2010Opps I deployed it again-ploneconf2010
Opps I deployed it again-ploneconf2010
 
Opps i deployed it again
Opps i deployed it againOpps i deployed it again
Opps i deployed it again
 
Plone for python programmers
Plone for python programmersPlone for python programmers
Plone for python programmers
 
TestBrowser Driven Development: How to get bulletproof code from lazy developers
TestBrowser Driven Development: How to get bulletproof code from lazy developersTestBrowser Driven Development: How to get bulletproof code from lazy developers
TestBrowser Driven Development: How to get bulletproof code from lazy developers
 
How to host an app for $20 in 20min using buildout and hostout
How to host an app  for $20 in 20min using buildout and hostoutHow to host an app  for $20 in 20min using buildout and hostout
How to host an app for $20 in 20min using buildout and hostout
 

Recently uploaded

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Recently uploaded (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 

The goodies of zope, pyramid, and plone (2)

  • 1. The goodies that Zope begat Pyramid, Plone, buildout + more Dylan Jay @djay75
  • 2. Who am I? Dylan Jay Core Plone Contributor 1995 First web app (ISAPI) 1999 Built first e-commerce site (zope) 2003 Built first startup (IntroVino) 2004 Started PretaWeb/PretaGov (Plone0
  • 3. Reasons for this talk History "Those who don't learn from history are doomed to add it as a feature of their framework" Better choices There is no perfect framework, only a perfect mess when you pick wrong Reuse
  • 4. The goodies 1. Traversal 2. ZODB 3. ZTK Adapters 4. Sprints 5. Pyramid 6. Buildout 7. Plone + the customisation cliff 8. Diazo 9. RobotFramework - RobotSuite
  • 5. Python family tree(web) Zope (1996-) ZTK (BlueBream) (2004-) Pylons/TurboGears (2005-2010)Django (2005-) Flask (2010-) RoR (2004-) Plone (1999-) BFG (2008-2010) CGI (1993-) httpd (1990-) NikolaPyramid (2010-)
  • 6. Zope - wtf was that about? Back in 1996 ● webserver = path to file ● cgi = path to script + args ● OO - was very big ● Jim Fulton was on a plane traversal = path to object + '/' + method zope = zope object publishing environment
  • 7. Goodie #1 - Traversal response = traverse(root, HTTP_PATH.split('/'), request) def traverse(context, path, request): if len(path) == 0: return context(request) elif len(path) == 1: view_method = getattr( context, path[0] ) return view_method(request) else: sub_context = context[ path[0] ] return traverse( sub_context, path[1:], request)
  • 8. Traversal - why? Good for CMS plugins cooperating webapps complex apps TraversalRoutes /A/B/C/myaction/myaction/id123 distributedcentrally defined Good for relational single use apps
  • 9. Goodie #2: ZODB ● Want to store something non relational? ● Want to store something non key-value? ● Got complex object structures? Use Object persistence
  • 10. ZODB: The piss easy DB $ easyinstall ZODB db = DB( FileStorage.FileStorage('./Data.fs') ) connection = db.open() dbroot = connection.root() transaction.commit() db.close() dbroot['a_number'] = 3 dbroot['a_string'] = 'Gift' dbroot['a_list'] = [1, 2, 3, 5, 7, 12] dbroot['a_dictionary'] = { 1918: 'Red Sox', 1919: 'Reds' } dbroot['deeply_nested'] = { 1918: [ ('Red Sox', 4), ('Cubs', 2) ], 1919: [ ('Reds', 5), ('White Sox', 3) ], }
  • 11. ZODB: simple but powerful ● transactions - multiversion concurrency control (MVCC) ● scalability across a network (using ZEO) ● replication (using ZRS or relstorage) ● history/undo ● transparently pluggable storage ● built-in caching ● Blob support
  • 13. Adapters: why? ● Solves how to plug complex software together ● Better than Object Orientation ● Perfect for overridable software ● Perfect for plugin architecture ● ZTK - ZCA - Zope3 == Adapters
  • 14. ZTK Adapters class IUSPlug(zope.interface): prongs = Attribute("""number of prongs""") class Motox(object): implements(IUSPlug) prongs = 2 class INZPlug(zope.interface): prongs = Attribute("""number of prongs""")
  • 15. ZTK Adapters class ACPowerAdapter(object): implements(INZPlug) adapts(IUSPlug) def __init__(self, plug): self.prongs = plug.prongs + 1 self.voltage = 240 registry.registerAdapter(ACPowerAdapter)
  • 16. ZTK Adapters >>> myphone = MotoX() >>> myphone.prongs == 3 False >>> adaptedphone = INZPlug(myphone) >>> adaptedphone.prongs == 3 True
  • 17. Goodie #4: Sprints “The practice of using sprints for open source software development was pioneered by the Zope Corporation in the early days of the Zope 3 project. Between January 2002 and January 2006, more than 30 Zope 3 sprints had taken place.[citation needed]” Plone Pacific Rim Sprint 14-15 Sept
  • 18. Goodie #5 Pyramid Zope (1996-) ZTK (BlueBream) (2004-) Pylons/TurboGears (2005-2010)Django (2005-) Flask (2010-) RoR (2004-) Plone (1999-) BFG (2008-2010) CGI (1993-) httpd (1990-) NikolaPyramid (2010-)
  • 19. Pyramid: It's micro! from wsgiref.simple_server import make_server from pyramid.view import view_config from pyramid.config import Configurator if __name__ == '__main__': config = Configurator() config.add_route('hello', '/hello/{name}') config.scan() app = config.make_wsgi_app() server = make_server('0.0.0.0', 8080, app) server.serve_forever() @view_config(route_name='hello', renderer='json') def hello_world(request): return {'content':'Hello %(name)s!' % request.matchdict}
  • 20. Pyramid: worst name ever Pyramid (the structure) Pyramid (the framework) Start big - End small Start small - End big Ancient Best of breed Unchanging over time Extensible & Flexible
  • 21. Pyramid: a "micro & more" Framework ● a declarative authorization system ● extensibility: aggregate Pyramid application configuration from multiple sources ● separate I18N translation string factories ● reuse: "Interface" based view/subscriber registrations ● optionally map URLs to code using traversal
  • 22. Pyramid: routes vs. traversal: why not both? from wsgiref.simple_server import make_server from pyramid.config import Configurator from pyramid.response import Response class Resource(dict): pass def get_root(request): return Resource({'a': Resource({'b': Resource({'c': Resource()})})}) def hello_world_of_resources(context, request): output = "Here's a resource and its children: %s" % context return Response(output) if __name__ == '__main__': config = Configurator(root_factory=get_root) config.add_view(hello_world_of_resources, context=Resource) app = config.make_wsgi_app() server = make_server('0.0.0.0', 8080, app) server.serve_forever()
  • 23. Goodie #6: buildout buildout - what you get if you put make, puppet, python, pip, virtualenv into a blender
  • 24. Buildout ● uses recipes - python packages that know how to build other things ○ like puppet ● automated dependencies ○ like Make ● recipes download and install python packages into your environment ○ like PIP/easy_install ● everything gets installed into a local directory isolated from your system ○ like virtualenv
  • 25. Buildout is like... you need it when - you’re on tour (deploy different places) - very different components
  • 26. Goodie #7: Plone 300+ core contributors 400+ plugins 1000+ commits/month 5-8 sprints per year 1 Plone foundation 1-2 CVE's/year
  • 27.
  • 28. Plone Plone step 1: Install wget --no-check-certificate https://launchpad. net/plone/4.3/4.3.1/+download/Plone-4.3.1- UnifiedInstaller.tgz # Extract the downloaded file tar -xf Plone-4.3-UnifiedInstaller.tgz # Go the folder containing installer script cd Plone-4.3-UnifiedInstaller # Run script ./install.sh standalone cd ~/Plone/zinstance bin/instance fg
  • 29. Plone: #2 Add content Plone Step 2: Add content
  • 30. Plone Step 3: Add plugins $ nano buildout.cfg [instance] ... eggs = Products.PloneFormGen collective.recaptcha $ bin/buildout $ bin/instance fg
  • 31. Plone Step 4: Theme it
  • 32. Framework vs CMS start with a blank page start with fully featured site build up customise down good for "app" sites good for "content" sites others can edit Framework CMS startup tool agency tool risk reinventing the wheel risk hitting customisation cliff dev has full control shared control, editors, admin, dev, themer
  • 33. Content Editor Site Admin Separation of concerns Backend devFrontend dev / Themer Integrator Reviewer
  • 35. An app/startup Backend devFrontend dev / Themer Django/Pyramid
  • 37. Large content site PluginsThemes Frontend dev / Themer Content Editor Site Admin Integrator Reviewer Enterprise CMS
  • 38. Web consultancy Plugins Frontend dev / Themer Content Editor Site Admin Integrator CMS/Framework
  • 40. Goodie #8: Diazo - Ultimate in code - html seperation - templates without altering your html - allows designer to work on html while you work on the code - round trip
  • 41. Diazo.org 1. app with very simple html - "content" 2. create mockups in html of how you want the pages to really look - "theme" 3. create a rules.xml. 4. Compile it to single XSLT file, 5. execute it in middleware
  • 42. Goodie #9: RobotFramework what you get when you put python, selenum and BDD into a blender
  • 44. RobotFramework ● Not invented by Plone/Zope (Nokia did) ● but robotsuite was ● Used to test Plone ● Automated screenshots for user manuals