SlideShare una empresa de Scribd logo
1 de 20
Descargar para leer sin conexión
REPOZE.BFG
Rok Garbas, python/zope/plone consultingOct. 2009
“Everything should be made as simple as possible, but not
simpler.” ~ Einstein
BFG is a "pay only for what you eat" Python web framework. You can get started
easily and learn new concepts as you go, and only if you need them. It's simple, well
tested, well documented, and fast.
http://bfg.repoze.org
WHAT MATTERS
I’M A PLONISTA, I LOVE PLONE, I LOVE PLONE
COMMUNITY, BUT…
ON THE END IT DOESN’T REALLY MATTER
WHAT YOU ARE USING
WHAT MATTER IS HOW PASIONATE YOU ARE
ABOUT IT
THANK YOU …
Chris McDonough
Tres Seaver
Paul Everitt,
Carlos de la Guardia
Malthe Borch
Stefan Eletzhofer
Fernando Neto-Correa
WHY NAME IT BFG
 repoze.bfg should have just been named "BFG".
 BFG's goals are somewhat sideways of the original
Repoze goals.
 The BFG 9000 is a fictional futuristic weapon found
in Doom. It is the most
powerful weapon in the
game, and is capable of
destroying nearly any
player or enemy with a
single hit.
ABOUT
 July 2008 – Initial release
 July 2009 – 1.0 released, API promissed to be
backwards compatible
 10th of October 2009 – Latest release … 1.1a5
 Allow Zope developers to use WSGI technologies
more easily and even out of Zope framework.
 Allow non-Zope developers to use Zope
technologies without using all of Zope.
WHY
ZOPE2 / PLONE
ZOPE 3
GROK
DJANGO
PYLONS / TG2
WHAT IT DOES
 Graph traversal / URL Dispatch: maps
URLs to code
 Security: provides mechanisms that allow
developers to make declarative security
assertions
 Templating: provides text and HTML
templating facilities
 Zope libs: use wonderful zope stuff
WHAT IT DOESN’T DO
 Database / persistence
 Sessions
 Indexing / searching
 ZMI / TTW code
 View code sharing with Z3 / Five
 ...
HOW YOUR BFG APP WORKS
You are not running framework and your application
inside it, like zope, instead you are running your
application alone.
INTERNET
WSGI + MIDDLEWARE
BFG ROUTER
YOUR APPLICATION
MODELS VIEWS TEMPLATES
ZOPE COMPONENT ARHITECTURE
 The Zope Component Architecture is a system for
runtime indirection ("pluggability"). Used only to
construct BFG.
 BFG application developers don't need to
understand the Zope CA. It's a framework
implementation detail.
Dependencies (22)
 Paste-1.7.2
 PasteScript-1.7.3
 PasteDeploy-1.3.3
 setuptools-0.6c8
 simplejson-2.0.9
 martian-0.12
 repoze.lru-0.3
 repoze.zcml
 zope.deprecation-3.4.0
 zope.component-3.7.1
 zope.interface-3.5.2
 WebOb-0.9.6.1
 chameleon.zpt-1.1.1
 chameleon.core-1.0.2
 zope.configuration-3.6.0
 zope.event-3.4.1
 zope.dottedname-3.4.6
 zope.i18n-3.7.1
 sourcecodegen-0.6.11
 zope.schema-3.5.4
 zope.i18nmessageid-3.5.0
 pytz-2009n
MODELS
 “content” objects. for Zope people, think of it as things we
store in ZODB
 ZODB not required for repoze.bfg applications: filesystem
directories, XML documents, RDF graphs, SQL databases, etc.
can be the source of model data
from zope.interface import implements
from zope.interface import Interface
class IMyModel(Interface):
pass
class MyModel(object):
implements(IMyModel)
def __init__(self, name):
self.name = name
VIEWS
 Views are functions which accept a "context" (a
model object) and a "request".
 Views must return a response. Unlike Zope.
 The view may use a template to generate the
response body, or not.
from repoze.bfg.chameleon_zpt 
import render_template_to_response
def hello_world(context, request):
render_template_to_response(
'templates/hello.pt',
context=context, myname='chris')
VIEW REGISTRATION
<configure xmlns="http://namespaces.zope.org/zope"
xmlns:bfg="http://namespaces.repoze.org/bfg"
i18n_domain="repoze.bfg">
<include package="repoze.bfg" />
<— default view for .interfaces.IMyModel —>
<bfg:view
for=".interfaces.IMyModel"
view=".views.my_view"
/>
<— named view for .interfaces.IMyModel —>
<bfg:view
for=".interfaces.IMyModel"
view=".views.other_view"
name="other"
/>
</configure>
VIEW REGISTRATION via DECORATORS
from webob import Response
from repoze.bfg.convention import bfg_view
from repoze.bfg.chameleon_zpt 
import render_template_to_response
@bfg_view(name='hello.html')
def hello_world(context, request):
render_template_to_response(
'templates/hello.pt',
context=context, myname='chris')
TEMPLATE
 Default templating engine: chalmeleon by Malthe
Borch. ZPT or Genshi syntax. ~10X - 15X faster
than zope.pagetemplate.
 Included: XSLT.
 Add-on: jinja2 (Django-style, via repoze.bfg.jinja2)
 Any other you'd like to use; bindings are simple to
create (see the jinja2 bindings).
TEMPLATE
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:tal="http://xml.zope.org/namespaces/tal">
<head>
<title tal:content="context.title">The title</title>
<meta http-equiv="content-type“
content="text/html;charset=utf-8"/>
</head>
<body>
<h2><span tal:replace="context.title_or_id()">content title
or id</span>
<span tal:condition="context.title“
tal:replace="context.title">optional template
title</span></h2>
This is Page Template <em
tal:content="request.view_name">template id</em>.
</body>
</html>
WSGI MIDDLEWARE
 Profiler (repoze.profile)
 Alternate exception handlers (paste.evalexception).
 Caching (repoze.accelerator)
 Theming (Deliverance).
 Transaction management (repoze.tm2)
 ...
FUTURE
 Vudo CMS (http://docs.vudo.me) to be
implemented using repoze.bfg, hopefully. Work
towards this: repoze.bfg.skins, repoze.bfg.layout,
repoze.bitblt, repoze.squeeze.
 BFG will stay minimal. Add-ons and
superframeworks like vudo and repoze.lemonade
will provide functionality.
Final words
TESTED
SIMPLE
MINIMAL
FAST
DOCUMENTED

Más contenido relacionado

La actualidad más candente

Building Desktop RIAs With PHP And JavaScript
Building Desktop RIAs With PHP And JavaScriptBuilding Desktop RIAs With PHP And JavaScript
Building Desktop RIAs With PHP And JavaScriptfunkatron
 
Java - A broad introduction
Java - A broad introductionJava - A broad introduction
Java - A broad introductionBirol Efe
 
Frontend automation and stability
Frontend automation and stabilityFrontend automation and stability
Frontend automation and stabilityMáté Nádasdi
 
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...Hafez Kamal
 
Enterprise PHP (php|works 2008)
Enterprise PHP (php|works 2008)Enterprise PHP (php|works 2008)
Enterprise PHP (php|works 2008)Ivo Jansch
 
Introduction To Django
Introduction To DjangoIntroduction To Django
Introduction To DjangoJay Graves
 
Object Oriented Design Patterns for PHP
Object Oriented Design Patterns for PHPObject Oriented Design Patterns for PHP
Object Oriented Design Patterns for PHPRobertGonzalez
 
Apigility – Lightning Fast API Development - OSSCamp 2014
Apigility – Lightning Fast API Development - OSSCamp 2014 Apigility – Lightning Fast API Development - OSSCamp 2014
Apigility – Lightning Fast API Development - OSSCamp 2014 OSSCube
 
Django, What is it, Why is it cool?
Django, What is it, Why is it cool?Django, What is it, Why is it cool?
Django, What is it, Why is it cool?Tom Brander
 
Whitebox testing of Spring Boot applications
Whitebox testing of Spring Boot applicationsWhitebox testing of Spring Boot applications
Whitebox testing of Spring Boot applicationsYura Nosenko
 
JS Frameworks Day April,26 of 2014
JS Frameworks Day April,26 of 2014JS Frameworks Day April,26 of 2014
JS Frameworks Day April,26 of 2014DA-14
 
Js fwdays unit tesing javascript(by Anna Khabibullina)
Js fwdays unit tesing javascript(by Anna Khabibullina)Js fwdays unit tesing javascript(by Anna Khabibullina)
Js fwdays unit tesing javascript(by Anna Khabibullina)Anna Khabibullina
 

La actualidad más candente (12)

Building Desktop RIAs With PHP And JavaScript
Building Desktop RIAs With PHP And JavaScriptBuilding Desktop RIAs With PHP And JavaScript
Building Desktop RIAs With PHP And JavaScript
 
Java - A broad introduction
Java - A broad introductionJava - A broad introduction
Java - A broad introduction
 
Frontend automation and stability
Frontend automation and stabilityFrontend automation and stability
Frontend automation and stability
 
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...
 
Enterprise PHP (php|works 2008)
Enterprise PHP (php|works 2008)Enterprise PHP (php|works 2008)
Enterprise PHP (php|works 2008)
 
Introduction To Django
Introduction To DjangoIntroduction To Django
Introduction To Django
 
Object Oriented Design Patterns for PHP
Object Oriented Design Patterns for PHPObject Oriented Design Patterns for PHP
Object Oriented Design Patterns for PHP
 
Apigility – Lightning Fast API Development - OSSCamp 2014
Apigility – Lightning Fast API Development - OSSCamp 2014 Apigility – Lightning Fast API Development - OSSCamp 2014
Apigility – Lightning Fast API Development - OSSCamp 2014
 
Django, What is it, Why is it cool?
Django, What is it, Why is it cool?Django, What is it, Why is it cool?
Django, What is it, Why is it cool?
 
Whitebox testing of Spring Boot applications
Whitebox testing of Spring Boot applicationsWhitebox testing of Spring Boot applications
Whitebox testing of Spring Boot applications
 
JS Frameworks Day April,26 of 2014
JS Frameworks Day April,26 of 2014JS Frameworks Day April,26 of 2014
JS Frameworks Day April,26 of 2014
 
Js fwdays unit tesing javascript(by Anna Khabibullina)
Js fwdays unit tesing javascript(by Anna Khabibullina)Js fwdays unit tesing javascript(by Anna Khabibullina)
Js fwdays unit tesing javascript(by Anna Khabibullina)
 

Similar a Everything Should Be Simple But Not Simpler - An Introduction to Repoze.BFG

Bfg Ploneconf Oct2008
Bfg Ploneconf Oct2008Bfg Ploneconf Oct2008
Bfg Ploneconf Oct2008Jeffrey Clark
 
Creating Custom Dojo Widgets Using WTP
Creating Custom Dojo Widgets Using WTPCreating Custom Dojo Widgets Using WTP
Creating Custom Dojo Widgets Using WTPnsandonato
 
Introduction to Groovy Monkey
Introduction to Groovy MonkeyIntroduction to Groovy Monkey
Introduction to Groovy Monkeyjervin
 
Reusando componentes Zope fuera de Zope
Reusando componentes Zope fuera de ZopeReusando componentes Zope fuera de Zope
Reusando componentes Zope fuera de Zopementtes
 
Philipp Von Weitershausen Plone Age Mammoths, Sabers And Caveen Cant The...
Philipp Von Weitershausen   Plone Age  Mammoths, Sabers And Caveen   Cant The...Philipp Von Weitershausen   Plone Age  Mammoths, Sabers And Caveen   Cant The...
Philipp Von Weitershausen Plone Age Mammoths, Sabers And Caveen Cant The...Vincenzo Barone
 
Andromance - Android Performance
Andromance - Android PerformanceAndromance - Android Performance
Andromance - Android PerformanceOrhun Mert Simsek
 
The goodies of zope, pyramid, and plone (2)
The goodies of zope, pyramid, and plone (2)The goodies of zope, pyramid, and plone (2)
The goodies of zope, pyramid, and plone (2)Dylan Jay
 
Create Your Own Framework by Fabien Potencier
Create Your Own Framework by Fabien PotencierCreate Your Own Framework by Fabien Potencier
Create Your Own Framework by Fabien PotencierHimel Nag Rana
 
Introduction to Google App Engine with Python
Introduction to Google App Engine with PythonIntroduction to Google App Engine with Python
Introduction to Google App Engine with PythonBrian Lyttle
 
When Good Code Goes Bad: Tools and Techniques for Troubleshooting Plone
When Good Code Goes Bad: Tools and Techniques for Troubleshooting PloneWhen Good Code Goes Bad: Tools and Techniques for Troubleshooting Plone
When Good Code Goes Bad: Tools and Techniques for Troubleshooting PloneDavid Glick
 
Buildout: creating and deploying repeatable applications in python
Buildout: creating and deploying repeatable applications in pythonBuildout: creating and deploying repeatable applications in python
Buildout: creating and deploying repeatable applications in pythonCodeSyntax
 
Lunch and learn as3_frameworks
Lunch and learn as3_frameworksLunch and learn as3_frameworks
Lunch and learn as3_frameworksYuri Visser
 
ElggCamp Santiago> For Developers!
ElggCamp Santiago> For Developers!ElggCamp Santiago> For Developers!
ElggCamp Santiago> For Developers!Condiminds
 
ElggCamp Santiago - Dev Edition
ElggCamp Santiago - Dev EditionElggCamp Santiago - Dev Edition
ElggCamp Santiago - Dev EditionBrett Profitt
 
web2py:Web development like a boss
web2py:Web development like a bossweb2py:Web development like a boss
web2py:Web development like a bossFrancisco Ribeiro
 
Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01Tony Frame
 
Rifartek Robot Training Course - How to use ClientRobot
Rifartek Robot Training Course - How to use ClientRobotRifartek Robot Training Course - How to use ClientRobot
Rifartek Robot Training Course - How to use ClientRobotTsai Tsung-Yi
 

Similar a Everything Should Be Simple But Not Simpler - An Introduction to Repoze.BFG (20)

Bfg Ploneconf Oct2008
Bfg Ploneconf Oct2008Bfg Ploneconf Oct2008
Bfg Ploneconf Oct2008
 
Creating Custom Dojo Widgets Using WTP
Creating Custom Dojo Widgets Using WTPCreating Custom Dojo Widgets Using WTP
Creating Custom Dojo Widgets Using WTP
 
Play framework
Play frameworkPlay framework
Play framework
 
Introduce Django
Introduce DjangoIntroduce Django
Introduce Django
 
Introduction to Groovy Monkey
Introduction to Groovy MonkeyIntroduction to Groovy Monkey
Introduction to Groovy Monkey
 
Reusando componentes Zope fuera de Zope
Reusando componentes Zope fuera de ZopeReusando componentes Zope fuera de Zope
Reusando componentes Zope fuera de Zope
 
Philipp Von Weitershausen Plone Age Mammoths, Sabers And Caveen Cant The...
Philipp Von Weitershausen   Plone Age  Mammoths, Sabers And Caveen   Cant The...Philipp Von Weitershausen   Plone Age  Mammoths, Sabers And Caveen   Cant The...
Philipp Von Weitershausen Plone Age Mammoths, Sabers And Caveen Cant The...
 
Andromance - Android Performance
Andromance - Android PerformanceAndromance - Android Performance
Andromance - Android Performance
 
The goodies of zope, pyramid, and plone (2)
The goodies of zope, pyramid, and plone (2)The goodies of zope, pyramid, and plone (2)
The goodies of zope, pyramid, and plone (2)
 
Dojo tutorial
Dojo tutorialDojo tutorial
Dojo tutorial
 
Create Your Own Framework by Fabien Potencier
Create Your Own Framework by Fabien PotencierCreate Your Own Framework by Fabien Potencier
Create Your Own Framework by Fabien Potencier
 
Introduction to Google App Engine with Python
Introduction to Google App Engine with PythonIntroduction to Google App Engine with Python
Introduction to Google App Engine with Python
 
When Good Code Goes Bad: Tools and Techniques for Troubleshooting Plone
When Good Code Goes Bad: Tools and Techniques for Troubleshooting PloneWhen Good Code Goes Bad: Tools and Techniques for Troubleshooting Plone
When Good Code Goes Bad: Tools and Techniques for Troubleshooting Plone
 
Buildout: creating and deploying repeatable applications in python
Buildout: creating and deploying repeatable applications in pythonBuildout: creating and deploying repeatable applications in python
Buildout: creating and deploying repeatable applications in python
 
Lunch and learn as3_frameworks
Lunch and learn as3_frameworksLunch and learn as3_frameworks
Lunch and learn as3_frameworks
 
ElggCamp Santiago> For Developers!
ElggCamp Santiago> For Developers!ElggCamp Santiago> For Developers!
ElggCamp Santiago> For Developers!
 
ElggCamp Santiago - Dev Edition
ElggCamp Santiago - Dev EditionElggCamp Santiago - Dev Edition
ElggCamp Santiago - Dev Edition
 
web2py:Web development like a boss
web2py:Web development like a bossweb2py:Web development like a boss
web2py:Web development like a boss
 
Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01
 
Rifartek Robot Training Course - How to use ClientRobot
Rifartek Robot Training Course - How to use ClientRobotRifartek Robot Training Course - How to use ClientRobot
Rifartek Robot Training Course - How to use ClientRobot
 

Más de maikroeder

Encode RNA Dashboard
Encode RNA DashboardEncode RNA Dashboard
Encode RNA Dashboardmaikroeder
 
Getting started with pandas
Getting started with pandasGetting started with pandas
Getting started with pandasmaikroeder
 
Introduction to ggplot2
Introduction to ggplot2Introduction to ggplot2
Introduction to ggplot2maikroeder
 
Cms - Content Management System Utilities for Django
Cms - Content Management System Utilities for DjangoCms - Content Management System Utilities for Django
Cms - Content Management System Utilities for Djangomaikroeder
 
Plone Conference 2007: Acceptance Testing In Plone Using Funittest - Maik Röder
Plone Conference 2007: Acceptance Testing In Plone Using Funittest - Maik RöderPlone Conference 2007: Acceptance Testing In Plone Using Funittest - Maik Röder
Plone Conference 2007: Acceptance Testing In Plone Using Funittest - Maik Rödermaikroeder
 

Más de maikroeder (7)

Google charts
Google chartsGoogle charts
Google charts
 
Encode RNA Dashboard
Encode RNA DashboardEncode RNA Dashboard
Encode RNA Dashboard
 
Pandas
PandasPandas
Pandas
 
Getting started with pandas
Getting started with pandasGetting started with pandas
Getting started with pandas
 
Introduction to ggplot2
Introduction to ggplot2Introduction to ggplot2
Introduction to ggplot2
 
Cms - Content Management System Utilities for Django
Cms - Content Management System Utilities for DjangoCms - Content Management System Utilities for Django
Cms - Content Management System Utilities for Django
 
Plone Conference 2007: Acceptance Testing In Plone Using Funittest - Maik Röder
Plone Conference 2007: Acceptance Testing In Plone Using Funittest - Maik RöderPlone Conference 2007: Acceptance Testing In Plone Using Funittest - Maik Röder
Plone Conference 2007: Acceptance Testing In Plone Using Funittest - Maik Röder
 

Último

The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 

Último (20)

The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 

Everything Should Be Simple But Not Simpler - An Introduction to Repoze.BFG

  • 1. REPOZE.BFG Rok Garbas, python/zope/plone consultingOct. 2009 “Everything should be made as simple as possible, but not simpler.” ~ Einstein BFG is a "pay only for what you eat" Python web framework. You can get started easily and learn new concepts as you go, and only if you need them. It's simple, well tested, well documented, and fast. http://bfg.repoze.org
  • 2. WHAT MATTERS I’M A PLONISTA, I LOVE PLONE, I LOVE PLONE COMMUNITY, BUT… ON THE END IT DOESN’T REALLY MATTER WHAT YOU ARE USING WHAT MATTER IS HOW PASIONATE YOU ARE ABOUT IT
  • 3. THANK YOU … Chris McDonough Tres Seaver Paul Everitt, Carlos de la Guardia Malthe Borch Stefan Eletzhofer Fernando Neto-Correa
  • 4. WHY NAME IT BFG  repoze.bfg should have just been named "BFG".  BFG's goals are somewhat sideways of the original Repoze goals.  The BFG 9000 is a fictional futuristic weapon found in Doom. It is the most powerful weapon in the game, and is capable of destroying nearly any player or enemy with a single hit.
  • 5. ABOUT  July 2008 – Initial release  July 2009 – 1.0 released, API promissed to be backwards compatible  10th of October 2009 – Latest release … 1.1a5  Allow Zope developers to use WSGI technologies more easily and even out of Zope framework.  Allow non-Zope developers to use Zope technologies without using all of Zope.
  • 6. WHY ZOPE2 / PLONE ZOPE 3 GROK DJANGO PYLONS / TG2
  • 7. WHAT IT DOES  Graph traversal / URL Dispatch: maps URLs to code  Security: provides mechanisms that allow developers to make declarative security assertions  Templating: provides text and HTML templating facilities  Zope libs: use wonderful zope stuff
  • 8. WHAT IT DOESN’T DO  Database / persistence  Sessions  Indexing / searching  ZMI / TTW code  View code sharing with Z3 / Five  ...
  • 9. HOW YOUR BFG APP WORKS You are not running framework and your application inside it, like zope, instead you are running your application alone. INTERNET WSGI + MIDDLEWARE BFG ROUTER YOUR APPLICATION MODELS VIEWS TEMPLATES
  • 10. ZOPE COMPONENT ARHITECTURE  The Zope Component Architecture is a system for runtime indirection ("pluggability"). Used only to construct BFG.  BFG application developers don't need to understand the Zope CA. It's a framework implementation detail.
  • 11. Dependencies (22)  Paste-1.7.2  PasteScript-1.7.3  PasteDeploy-1.3.3  setuptools-0.6c8  simplejson-2.0.9  martian-0.12  repoze.lru-0.3  repoze.zcml  zope.deprecation-3.4.0  zope.component-3.7.1  zope.interface-3.5.2  WebOb-0.9.6.1  chameleon.zpt-1.1.1  chameleon.core-1.0.2  zope.configuration-3.6.0  zope.event-3.4.1  zope.dottedname-3.4.6  zope.i18n-3.7.1  sourcecodegen-0.6.11  zope.schema-3.5.4  zope.i18nmessageid-3.5.0  pytz-2009n
  • 12. MODELS  “content” objects. for Zope people, think of it as things we store in ZODB  ZODB not required for repoze.bfg applications: filesystem directories, XML documents, RDF graphs, SQL databases, etc. can be the source of model data from zope.interface import implements from zope.interface import Interface class IMyModel(Interface): pass class MyModel(object): implements(IMyModel) def __init__(self, name): self.name = name
  • 13. VIEWS  Views are functions which accept a "context" (a model object) and a "request".  Views must return a response. Unlike Zope.  The view may use a template to generate the response body, or not. from repoze.bfg.chameleon_zpt import render_template_to_response def hello_world(context, request): render_template_to_response( 'templates/hello.pt', context=context, myname='chris')
  • 14. VIEW REGISTRATION <configure xmlns="http://namespaces.zope.org/zope" xmlns:bfg="http://namespaces.repoze.org/bfg" i18n_domain="repoze.bfg"> <include package="repoze.bfg" /> <— default view for .interfaces.IMyModel —> <bfg:view for=".interfaces.IMyModel" view=".views.my_view" /> <— named view for .interfaces.IMyModel —> <bfg:view for=".interfaces.IMyModel" view=".views.other_view" name="other" /> </configure>
  • 15. VIEW REGISTRATION via DECORATORS from webob import Response from repoze.bfg.convention import bfg_view from repoze.bfg.chameleon_zpt import render_template_to_response @bfg_view(name='hello.html') def hello_world(context, request): render_template_to_response( 'templates/hello.pt', context=context, myname='chris')
  • 16. TEMPLATE  Default templating engine: chalmeleon by Malthe Borch. ZPT or Genshi syntax. ~10X - 15X faster than zope.pagetemplate.  Included: XSLT.  Add-on: jinja2 (Django-style, via repoze.bfg.jinja2)  Any other you'd like to use; bindings are simple to create (see the jinja2 bindings).
  • 17. TEMPLATE <html xmlns="http://www.w3.org/1999/xhtml" xmlns:tal="http://xml.zope.org/namespaces/tal"> <head> <title tal:content="context.title">The title</title> <meta http-equiv="content-type“ content="text/html;charset=utf-8"/> </head> <body> <h2><span tal:replace="context.title_or_id()">content title or id</span> <span tal:condition="context.title“ tal:replace="context.title">optional template title</span></h2> This is Page Template <em tal:content="request.view_name">template id</em>. </body> </html>
  • 18. WSGI MIDDLEWARE  Profiler (repoze.profile)  Alternate exception handlers (paste.evalexception).  Caching (repoze.accelerator)  Theming (Deliverance).  Transaction management (repoze.tm2)  ...
  • 19. FUTURE  Vudo CMS (http://docs.vudo.me) to be implemented using repoze.bfg, hopefully. Work towards this: repoze.bfg.skins, repoze.bfg.layout, repoze.bitblt, repoze.squeeze.  BFG will stay minimal. Add-ons and superframeworks like vudo and repoze.lemonade will provide functionality.