SlideShare uma empresa Scribd logo
STANDING ON THE SHOULDERS OF GIANTS
THE WEB APPLICATION FRAMEWORKKOTTI
ANDREAS KAISER
|Owner & CTO of Xo7 GmbH Willich, Germany (next to Düsseldorf)
| |@diskokaiser disko irc://irc.freenode.net/#kotti
THIS TALK
Why does Kotti exist?
Who are these giants?
How are they utilized by Kotti?
Example / Code
Q&A (if we have time)
WHY?
YET ANOTHER WEB FRAMEWORK?
FEATURES
full featured CMS
lots of add ons (varying quality)
OFS (object file system)
security (permissions, roles, groups)
workflows
Can be a perfect choice when it fits your needs
BUT
does not fit all kinds of applications.
multiple competing technologies
doesn't conform to "The Zen of Python"
complex
 
FEATURES
small core
excellent documentation
pythonic
low level (micro framework)
unopinionated
persistence
templating / forms
authentication / authorization sources
“framework framework”
CONCLUSION
only provides stuff we need
doesn't come with unneeded ballast
no need to
“waste time fighting the framework's decisions”
perfect foundation!
MAKE SOME CHOICES!
persistence
traversal or URL dispatch
templating & forms
authentication & authorization sources
probably the most advanced ORM for Python
database agnostic
has many nice, useful features
hybrid properties
association proxies
ordering list
transaction integration with pyramid
THE NODE CLASS
adjacency list pattern
parent
children
single root node => node tree
dictionary protocol
THE NODE CLASS
DICTIONARY PROTOCOL
from kotti.resources import Document
from kotti.resources import get_root
root = get_root()
root['about']
<Document 2 at /about>
root['my-document'] = Document(title='My Document', description='foo',
body='<p>some HTML</p>')
THE NODE CLASS
TRAVERSAL
a = root['a'] = Document(title='A', description='Document A')
b = root['a']['b'] = Document(title='B', description='Document B')
c = root['a']['b']['c'] = Document(title='C', description='Document C')
Object URL
a /a
b /a/b
c /a/b/c
POLIMORPHIC QUERIES
from kotti.resources import get_root
from kotti.resources import Node
root = get_root()
print root.children:
print(type(c))
"<class 'kotti.resources.Document'>"
"<class 'kotti.resources.File'>"
print Node.query.filter(Node.title == 'My Document').one()
"<Document 5 at /my-document>"
JOINED TABLE INHERITANCE
class hierarchy is broken up among dependent tables
each class represented by its own table
the respective table only includes attributes local to that class
EVENTS
before_flush
ObjectUpdate
ObjectInsert
ObjectDelete
ALEMBIC
DB migrations
DDL (transactional, if supported by DBMS)
DML
environments
has all the components for modern UIs
responsive
well known
easy to customize
COLANDER
define data schema
validate & deserialize
HTML forms
JSON
XML
serialize Python structures to
strings
mappings
lists
DEFORM
render HTML forms from structures serialized by Colander
outputs Bootstrap 3 forms (Deform 2)
a content workflow system
states define
role / permission mapping
transitions define
from_state
to_state
required permission
storing and serving files in web applications
multiple backends
local filesystem
S3
GridFS
roll your own
integrates with SQLAlchemy
files are handled like a plain model attribute
transaction aware
WIRING IT ALL TOGETHER…
started by Daniel Nouri in 2011
BSD licensed
1.0.0 in January 2015
current version: 1.1.4
9k downloads per month
still small, but active & healthy community
contributions are always welcome
CODE QUALITY
a.k.a. "everyone loves badges"
coverage 95%
almost Heisenberg quality
build passing
continuous integration (Python 2.6, 2.7, PostgreSQL, MySQL, SQLite)
 
code quality A code climate 2.6 issuesissues ­­ 55 2525 3939
static code analysis ( , , )
requirements up­to­date
(except 1 testing requirement)Codacy Code Climate QuantifiedCode
CONFIGURATION
[app:kotti]
use = egg:kotti
sqlalchemy.url = sqlite:///%(here)s/Kotti.db
# sqlalchemy.url = postgres://user:pass@host/db
kotti.configurators =
kotti_tinymce.kotti_configure
kotti_youraddon.kotti_configure
[filter:fanstatic]
use = egg:fanstatic#fanstatic
[pipeline:main]
pipeline =
fanstatic
kotti
[server:main]
use = egg:waitress#main
host = 127.0.0.1
port = 5000
EXAMPLE OPTIONS
Option Purpose
kotti.available_types List of active content types
kotti.configurators List of advanced functions for config
kotti.root_factory Override Kotti’s default Pyramid root factory
kotti.populators List of functions to fill initial database
kotti.search_content Override Kotti’s default search function
kotti.asset_overrides Override Kotti’s templates
kotti.authn_policy_factory Component used for authentication
kotti.authz_policy_factory Component used for authorization
EXAMPLE OPTIONS (CONTINUED)
Option Purpose
kotti.caching_policy_chooser Component for choosing the cache header policy
kotti.url_normalizer Component used for url normalization
kotti.max_file_size Max size for file uploads
kotti.depot.*.* Configure the blob storage
kotti.sanitizers Configure available sanitizers
kotti.sanitize_on_write Configure sanitizers to be used on write access to resource objects
SECURITY
use SQLAlchemy to…
store pricipals (users & groups) in the DB
attach (inheritable) ACLs to each node
use Pyramid for…
authentication
authorization
use repoze.workflow to…
recompute ACLs on workflow state changes
EXAMPLE
CREATING AN ADDON
$ pcreate -s kotti kotti_myaddon
Author name [Andreas Kaiser]:
Author email [disko@binary-punks.com]:
Github username [Kotti]:
[… lot of output …]
===============================================================================
Welcome to Kotti!
Documentation: http://kotti.readthedocs.org/
Development: https://github.com/Kotti/Kotti/
Issues: https://github.com/Kotti/Kotti/issues?state=open
IRC: irc://irc.freenode.net/#kotti
Mailing List: https://groups.google.com/group/kotti
===============================================================================
CUSTOM CONTENT TYPE
from kotti.resources import Content
from sqlalchemy import *
class Document(Content):
id = Column(Integer(),
ForeignKey('contents.id'),
primary_key=True)
body = Column(UnicodeText())
mime_type = Column(String(30))
type_info = Content.type_info.copy(
name=u'Document',
title=_(u'Document'),
add_view=u'add_document',
addable_to=[u'Document'])
SCHEMA DEFINITION FOR
VALIDATION AND FORM CREATION
import colander
import deform
from kotti.views.edit.content import ContentSchema
class DocumentSchema(ContentSchema):
body = colander.SchemaNode(
colander.String(),
title=_(u'Body'),
widget=deform.widget.RichTextWidget(),
missing=u"")
ADD / EDIT FORMS
from kotti.resources import Document
from kotti.views.form import AddFormView
from kotti.views.form import EditFormView
from pyramid.view import view_config
@view_config(name=Document.type_info.add_view, permission='add',
renderer='kotti:templates/edit/node.pt')
class DocumentAddForm(AddFormView):
schema_factory = DocumentSchema
add = Document
item_type = _(u"Document")
@view_config(context=Document, name='edit', permission='edit',
renderer='kotti:templates/edit/node.pt')
class DocumentEditForm(EditFormView):
schema_factory = DocumentSchema
VIEW(S)
from pyramid.view import view_config
@view_config(name='view', context=Document, permission='view',
renderer='kotti:templates/view/document.pt')
def document_view(context, request):
return {}
OR
from pyramid.view import view_config
from pyramid.view import view_defaults
from kotti.views import BaseView
@view_defaults(context=Document, permission='view')
class DocumentViews(BaseView):
@view_config(name='view', renderer='kotti:templates/view/document.pt')
def view(self):
return {}
@view_config(name='view2', renderer='kotti:templates/view/document2.pt')
def view(self):
return {'answer': 42}
@view_config(name='json', renderer='json')
def view(self):
return {'title': self.context.title, 'body': self.context.body, ...}
# return self.context
TEMPLATE(S)
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
metal:use-macro="api.macro('kotti:templates/view/master.pt')">
<article metal:fill-slot="content" class="document-view content">
<h1>${context.title}</h1>
<p class="lead">
${context.description}
</p>
<div tal:replace="api.render_template('kotti:templates/view/tags.pt')" />
<div class="body" tal:content="structure context.body | None">
</div>
</article>
</html>
THE FUTURE
will always stay “lean and mean in all of the right ways”
Python 3 support
THANK YOU!
QUESTIONS?

Mais conteúdo relacionado

Mais procurados

Talk on .NET assemblies
Talk on .NET assembliesTalk on .NET assemblies
Talk on .NET assemblies
Vidya Agarwal
 
Docker and java
Docker and javaDocker and java
Docker and java
Anthony Dahanne
 
Cloud Native Computing - Part III - Containers
Cloud Native Computing - Part III - ContainersCloud Native Computing - Part III - Containers
Cloud Native Computing - Part III - Containers
Linjith Kunnon
 
Part 1 of the REAL Webinars on Oracle Cloud Native Application Development
Part 1 of the REAL Webinars on Oracle Cloud Native Application DevelopmentPart 1 of the REAL Webinars on Oracle Cloud Native Application Development
Part 1 of the REAL Webinars on Oracle Cloud Native Application Development
Lucas Jellema
 
Virtual machines and containers
Virtual machines and containersVirtual machines and containers
Virtual machines and containers
Patrick Pierson
 
Modernizing existing .NET applications with Windows Containers and Azure cloud
Modernizing existing .NET applications with Windows Containers and Azure cloudModernizing existing .NET applications with Windows Containers and Azure cloud
Modernizing existing .NET applications with Windows Containers and Azure cloud
Microsoft Tech Community
 
Kubernetes
KubernetesKubernetes
Kubernetes
Linjith Kunnon
 
HA Kubernetes on Mesos / Marathon
HA Kubernetes on Mesos / MarathonHA Kubernetes on Mesos / Marathon
HA Kubernetes on Mesos / Marathon
Cobus Bernard
 
Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...
Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...
Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...
Edureka!
 
Secrets of .NET Assemblies and Memory Management
Secrets of .NET Assemblies and Memory ManagementSecrets of .NET Assemblies and Memory Management
Secrets of .NET Assemblies and Memory Management
Abhishek Sur
 
Jenkins advance topic
Jenkins advance topicJenkins advance topic
Jenkins advance topic
Kalkey
 
Cloud Native Computing - Part II - Public Cloud (AWS)
Cloud Native Computing - Part II - Public Cloud (AWS)Cloud Native Computing - Part II - Public Cloud (AWS)
Cloud Native Computing - Part II - Public Cloud (AWS)
Linjith Kunnon
 
Mesosphere and the Enterprise: Run Your Applications on Apache Mesos - Steve ...
Mesosphere and the Enterprise: Run Your Applications on Apache Mesos - Steve ...Mesosphere and the Enterprise: Run Your Applications on Apache Mesos - Steve ...
Mesosphere and the Enterprise: Run Your Applications on Apache Mesos - Steve ...
{code} by Dell EMC
 
컨테이너 기술 소개 - Warden, Garden, Docker
컨테이너 기술 소개 - Warden, Garden, Docker컨테이너 기술 소개 - Warden, Garden, Docker
컨테이너 기술 소개 - Warden, Garden, Docker
seungdon Choi
 
Entity framework 6
Entity framework 6Entity framework 6
Entity framework 6
Ken Tucker
 
TechBeats #2
TechBeats #2TechBeats #2
TechBeats #2
applausepoland
 
There's More to Docker than the Container: The Docker Platform - Kendrick Col...
There's More to Docker than the Container: The Docker Platform - Kendrick Col...There's More to Docker than the Container: The Docker Platform - Kendrick Col...
There's More to Docker than the Container: The Docker Platform - Kendrick Col...
{code} by Dell EMC
 
Axigen on docker
Axigen on dockerAxigen on docker
Mesos ♥ Docker
Mesos ♥ DockerMesos ♥ Docker
Mesos ♥ Docker
Aish Fenton
 
Cloud Foundry and OpenStack - A Marriage Made in Heaven! (Cloud Foundry Summi...
Cloud Foundry and OpenStack - A Marriage Made in Heaven! (Cloud Foundry Summi...Cloud Foundry and OpenStack - A Marriage Made in Heaven! (Cloud Foundry Summi...
Cloud Foundry and OpenStack - A Marriage Made in Heaven! (Cloud Foundry Summi...
VMware Tanzu
 

Mais procurados (20)

Talk on .NET assemblies
Talk on .NET assembliesTalk on .NET assemblies
Talk on .NET assemblies
 
Docker and java
Docker and javaDocker and java
Docker and java
 
Cloud Native Computing - Part III - Containers
Cloud Native Computing - Part III - ContainersCloud Native Computing - Part III - Containers
Cloud Native Computing - Part III - Containers
 
Part 1 of the REAL Webinars on Oracle Cloud Native Application Development
Part 1 of the REAL Webinars on Oracle Cloud Native Application DevelopmentPart 1 of the REAL Webinars on Oracle Cloud Native Application Development
Part 1 of the REAL Webinars on Oracle Cloud Native Application Development
 
Virtual machines and containers
Virtual machines and containersVirtual machines and containers
Virtual machines and containers
 
Modernizing existing .NET applications with Windows Containers and Azure cloud
Modernizing existing .NET applications with Windows Containers and Azure cloudModernizing existing .NET applications with Windows Containers and Azure cloud
Modernizing existing .NET applications with Windows Containers and Azure cloud
 
Kubernetes
KubernetesKubernetes
Kubernetes
 
HA Kubernetes on Mesos / Marathon
HA Kubernetes on Mesos / MarathonHA Kubernetes on Mesos / Marathon
HA Kubernetes on Mesos / Marathon
 
Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...
Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...
Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...
 
Secrets of .NET Assemblies and Memory Management
Secrets of .NET Assemblies and Memory ManagementSecrets of .NET Assemblies and Memory Management
Secrets of .NET Assemblies and Memory Management
 
Jenkins advance topic
Jenkins advance topicJenkins advance topic
Jenkins advance topic
 
Cloud Native Computing - Part II - Public Cloud (AWS)
Cloud Native Computing - Part II - Public Cloud (AWS)Cloud Native Computing - Part II - Public Cloud (AWS)
Cloud Native Computing - Part II - Public Cloud (AWS)
 
Mesosphere and the Enterprise: Run Your Applications on Apache Mesos - Steve ...
Mesosphere and the Enterprise: Run Your Applications on Apache Mesos - Steve ...Mesosphere and the Enterprise: Run Your Applications on Apache Mesos - Steve ...
Mesosphere and the Enterprise: Run Your Applications on Apache Mesos - Steve ...
 
컨테이너 기술 소개 - Warden, Garden, Docker
컨테이너 기술 소개 - Warden, Garden, Docker컨테이너 기술 소개 - Warden, Garden, Docker
컨테이너 기술 소개 - Warden, Garden, Docker
 
Entity framework 6
Entity framework 6Entity framework 6
Entity framework 6
 
TechBeats #2
TechBeats #2TechBeats #2
TechBeats #2
 
There's More to Docker than the Container: The Docker Platform - Kendrick Col...
There's More to Docker than the Container: The Docker Platform - Kendrick Col...There's More to Docker than the Container: The Docker Platform - Kendrick Col...
There's More to Docker than the Container: The Docker Platform - Kendrick Col...
 
Axigen on docker
Axigen on dockerAxigen on docker
Axigen on docker
 
Mesos ♥ Docker
Mesos ♥ DockerMesos ♥ Docker
Mesos ♥ Docker
 
Cloud Foundry and OpenStack - A Marriage Made in Heaven! (Cloud Foundry Summi...
Cloud Foundry and OpenStack - A Marriage Made in Heaven! (Cloud Foundry Summi...Cloud Foundry and OpenStack - A Marriage Made in Heaven! (Cloud Foundry Summi...
Cloud Foundry and OpenStack - A Marriage Made in Heaven! (Cloud Foundry Summi...
 

Destaque

Son 6 yılda Facebook infografisi
Son 6 yılda Facebook infografisiSon 6 yılda Facebook infografisi
Son 6 yılda Facebook infografisi
quisif
 
Presentation Scotland
Presentation ScotlandPresentation Scotland
Presentation Scotland
anneleenreynders
 
João Game
João GameJoão Game
João Game
João Resende
 
DC Titanium User Group Meetup: Appcelerator Titanium Alloy jan2013
DC Titanium User Group Meetup: Appcelerator Titanium Alloy jan2013DC Titanium User Group Meetup: Appcelerator Titanium Alloy jan2013
DC Titanium User Group Meetup: Appcelerator Titanium Alloy jan2013
Aaron Saunders
 
Getting Started with Appcelerator Alloy - Cross Platform Mobile Development -...
Getting Started with Appcelerator Alloy - Cross Platform Mobile Development -...Getting Started with Appcelerator Alloy - Cross Platform Mobile Development -...
Getting Started with Appcelerator Alloy - Cross Platform Mobile Development -...
Aaron Saunders
 
2016 open day event guide
2016 open day event guide2016 open day event guide
2016 open day event guide
Tariq Mahmood
 
Presentasi sip kelompok 5
Presentasi sip kelompok 5Presentasi sip kelompok 5
Presentasi sip kelompok 5
Ade Frihadi
 
Techos
TechosTechos
Techos
mueblesbeype
 
Appcelerator Titanium Alloy + Kinvey Collection Databinding - Part One
Appcelerator Titanium Alloy + Kinvey Collection Databinding - Part OneAppcelerator Titanium Alloy + Kinvey Collection Databinding - Part One
Appcelerator Titanium Alloy + Kinvey Collection Databinding - Part One
Aaron Saunders
 
Project γαλλικών
Project γαλλικώνProject γαλλικών
Project γαλλικώνergasies
 
Alloy Simple App Demonstration
Alloy Simple App DemonstrationAlloy Simple App Demonstration
Alloy Simple App Demonstration
Aaron Saunders
 
Analisa performance voip sip trunking pada vpn vtun
Analisa performance voip sip trunking pada vpn vtunAnalisa performance voip sip trunking pada vpn vtun
Analisa performance voip sip trunking pada vpn vtun
Ade Frihadi
 
Introduction to road safety
Introduction to road safetyIntroduction to road safety
Introduction to road safety
Universiti Tun Hussein Onn Malaysia
 

Destaque (13)

Son 6 yılda Facebook infografisi
Son 6 yılda Facebook infografisiSon 6 yılda Facebook infografisi
Son 6 yılda Facebook infografisi
 
Presentation Scotland
Presentation ScotlandPresentation Scotland
Presentation Scotland
 
João Game
João GameJoão Game
João Game
 
DC Titanium User Group Meetup: Appcelerator Titanium Alloy jan2013
DC Titanium User Group Meetup: Appcelerator Titanium Alloy jan2013DC Titanium User Group Meetup: Appcelerator Titanium Alloy jan2013
DC Titanium User Group Meetup: Appcelerator Titanium Alloy jan2013
 
Getting Started with Appcelerator Alloy - Cross Platform Mobile Development -...
Getting Started with Appcelerator Alloy - Cross Platform Mobile Development -...Getting Started with Appcelerator Alloy - Cross Platform Mobile Development -...
Getting Started with Appcelerator Alloy - Cross Platform Mobile Development -...
 
2016 open day event guide
2016 open day event guide2016 open day event guide
2016 open day event guide
 
Presentasi sip kelompok 5
Presentasi sip kelompok 5Presentasi sip kelompok 5
Presentasi sip kelompok 5
 
Techos
TechosTechos
Techos
 
Appcelerator Titanium Alloy + Kinvey Collection Databinding - Part One
Appcelerator Titanium Alloy + Kinvey Collection Databinding - Part OneAppcelerator Titanium Alloy + Kinvey Collection Databinding - Part One
Appcelerator Titanium Alloy + Kinvey Collection Databinding - Part One
 
Project γαλλικών
Project γαλλικώνProject γαλλικών
Project γαλλικών
 
Alloy Simple App Demonstration
Alloy Simple App DemonstrationAlloy Simple App Demonstration
Alloy Simple App Demonstration
 
Analisa performance voip sip trunking pada vpn vtun
Analisa performance voip sip trunking pada vpn vtunAnalisa performance voip sip trunking pada vpn vtun
Analisa performance voip sip trunking pada vpn vtun
 
Introduction to road safety
Introduction to road safetyIntroduction to road safety
Introduction to road safety
 

Semelhante a Standing on the Shoulders of Giants – The Kotti Web Application Framework

Building Cloud-Native Applications with Microsoft Windows Azure
Building Cloud-Native Applications with Microsoft Windows AzureBuilding Cloud-Native Applications with Microsoft Windows Azure
Building Cloud-Native Applications with Microsoft Windows Azure
Bill Wilder
 
.NET TECHNOLOGIES
.NET TECHNOLOGIES.NET TECHNOLOGIES
.NET TECHNOLOGIES
Prof Ansari
 
Meteor Angular
Meteor AngularMeteor Angular
Meteor Angular
Pavel Kurnosov
 
Top 8 WCM Trends 2010
Top 8 WCM Trends 2010Top 8 WCM Trends 2010
Top 8 WCM Trends 2010
David Nuescheler
 
Brk2051 sql server on linux and docker
Brk2051 sql server on linux and dockerBrk2051 sql server on linux and docker
Brk2051 sql server on linux and docker
Bob Ward
 
android sqlite
android sqliteandroid sqlite
android sqlite
Deepa Rani
 
Obevo Javasig.pptx
Obevo Javasig.pptxObevo Javasig.pptx
Obevo Javasig.pptx
LadduAnanu
 
RavenDB overview
RavenDB overviewRavenDB overview
RavenDB overview
Igor Moochnick
 
Experiences using CouchDB inside Microsoft's Azure team
Experiences using CouchDB inside Microsoft's Azure teamExperiences using CouchDB inside Microsoft's Azure team
Experiences using CouchDB inside Microsoft's Azure team
Brian Benz
 
Common primitives in Docker environments
Common primitives in Docker environmentsCommon primitives in Docker environments
Common primitives in Docker environments
alexandru giurgiu
 
Creation of cloud application using microsoft azure by vaishali sahare [katkar]
Creation of cloud application using microsoft azure by vaishali sahare [katkar]Creation of cloud application using microsoft azure by vaishali sahare [katkar]
Creation of cloud application using microsoft azure by vaishali sahare [katkar]
vaishalisahare123
 
Azure Platform
Azure Platform Azure Platform
Azure Platform
Wes Yanaga
 
Microsoft cloud 101
Microsoft cloud 101Microsoft cloud 101
Microsoft cloud 101
Rateb Abu Hawieleh
 
Containers in depth – Understanding how containers work to better work with c...
Containers in depth – Understanding how containers work to better work with c...Containers in depth – Understanding how containers work to better work with c...
Containers in depth – Understanding how containers work to better work with c...
All Things Open
 
Introduction to Azure Cloud Storage
Introduction to Azure Cloud StorageIntroduction to Azure Cloud Storage
Introduction to Azure Cloud Storage
Ganga R Jaiswal
 
Azure Data Storage
Azure Data StorageAzure Data Storage
Azure Data Storage
Ken Cenerelli
 
Azure: Lessons From The Field
Azure: Lessons From The FieldAzure: Lessons From The Field
Azure: Lessons From The Field
Rob Gillen
 
How to get started with Oracle Cloud Infrastructure
How to get started with Oracle Cloud InfrastructureHow to get started with Oracle Cloud Infrastructure
How to get started with Oracle Cloud Infrastructure
Simo Vilmunen
 
Docker training
Docker trainingDocker training
Docker training
Kiran Kumar
 
Windows azure camp
Windows azure campWindows azure camp
Windows azure camp
Abhishek Sur
 

Semelhante a Standing on the Shoulders of Giants – The Kotti Web Application Framework (20)

Building Cloud-Native Applications with Microsoft Windows Azure
Building Cloud-Native Applications with Microsoft Windows AzureBuilding Cloud-Native Applications with Microsoft Windows Azure
Building Cloud-Native Applications with Microsoft Windows Azure
 
.NET TECHNOLOGIES
.NET TECHNOLOGIES.NET TECHNOLOGIES
.NET TECHNOLOGIES
 
Meteor Angular
Meteor AngularMeteor Angular
Meteor Angular
 
Top 8 WCM Trends 2010
Top 8 WCM Trends 2010Top 8 WCM Trends 2010
Top 8 WCM Trends 2010
 
Brk2051 sql server on linux and docker
Brk2051 sql server on linux and dockerBrk2051 sql server on linux and docker
Brk2051 sql server on linux and docker
 
android sqlite
android sqliteandroid sqlite
android sqlite
 
Obevo Javasig.pptx
Obevo Javasig.pptxObevo Javasig.pptx
Obevo Javasig.pptx
 
RavenDB overview
RavenDB overviewRavenDB overview
RavenDB overview
 
Experiences using CouchDB inside Microsoft's Azure team
Experiences using CouchDB inside Microsoft's Azure teamExperiences using CouchDB inside Microsoft's Azure team
Experiences using CouchDB inside Microsoft's Azure team
 
Common primitives in Docker environments
Common primitives in Docker environmentsCommon primitives in Docker environments
Common primitives in Docker environments
 
Creation of cloud application using microsoft azure by vaishali sahare [katkar]
Creation of cloud application using microsoft azure by vaishali sahare [katkar]Creation of cloud application using microsoft azure by vaishali sahare [katkar]
Creation of cloud application using microsoft azure by vaishali sahare [katkar]
 
Azure Platform
Azure Platform Azure Platform
Azure Platform
 
Microsoft cloud 101
Microsoft cloud 101Microsoft cloud 101
Microsoft cloud 101
 
Containers in depth – Understanding how containers work to better work with c...
Containers in depth – Understanding how containers work to better work with c...Containers in depth – Understanding how containers work to better work with c...
Containers in depth – Understanding how containers work to better work with c...
 
Introduction to Azure Cloud Storage
Introduction to Azure Cloud StorageIntroduction to Azure Cloud Storage
Introduction to Azure Cloud Storage
 
Azure Data Storage
Azure Data StorageAzure Data Storage
Azure Data Storage
 
Azure: Lessons From The Field
Azure: Lessons From The FieldAzure: Lessons From The Field
Azure: Lessons From The Field
 
How to get started with Oracle Cloud Infrastructure
How to get started with Oracle Cloud InfrastructureHow to get started with Oracle Cloud Infrastructure
How to get started with Oracle Cloud Infrastructure
 
Docker training
Docker trainingDocker training
Docker training
 
Windows azure camp
Windows azure campWindows azure camp
Windows azure camp
 

Último

如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
gapen1
 
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdfThe Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
kalichargn70th171
 
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptxOperational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
sandeepmenon62
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
dakas1
 
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Paul Brebner
 
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
kalichargn70th171
 
Boost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management AppsBoost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management Apps
Jhone kinadey
 
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptxMigration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
ervikas4
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
Bert Jan Schrijver
 
Cost-Effective Strategies For iOS App Development
Cost-Effective Strategies For iOS App DevelopmentCost-Effective Strategies For iOS App Development
Cost-Effective Strategies For iOS App Development
Softradix Technologies
 
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
OnePlan Solutions
 
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data PlatformAlluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio, Inc.
 
Orca: Nocode Graphical Editor for Container Orchestration
Orca: Nocode Graphical Editor for Container OrchestrationOrca: Nocode Graphical Editor for Container Orchestration
Orca: Nocode Graphical Editor for Container Orchestration
Pedro J. Molina
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
Alina Yurenko
 
Microsoft-Power-Platform-Adoption-Planning.pptx
Microsoft-Power-Platform-Adoption-Planning.pptxMicrosoft-Power-Platform-Adoption-Planning.pptx
Microsoft-Power-Platform-Adoption-Planning.pptx
jrodriguezq3110
 
Ensuring Efficiency and Speed with Practical Solutions for Clinical Operations
Ensuring Efficiency and Speed with Practical Solutions for Clinical OperationsEnsuring Efficiency and Speed with Practical Solutions for Clinical Operations
Ensuring Efficiency and Speed with Practical Solutions for Clinical Operations
OnePlan Solutions
 
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
Luigi Fugaro
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
Alberto Brandolini
 
Streamlining End-to-End Testing Automation
Streamlining End-to-End Testing AutomationStreamlining End-to-End Testing Automation
Streamlining End-to-End Testing Automation
Anand Bagmar
 
Secure-by-Design Using Hardware and Software Protection for FDA Compliance
Secure-by-Design Using Hardware and Software Protection for FDA ComplianceSecure-by-Design Using Hardware and Software Protection for FDA Compliance
Secure-by-Design Using Hardware and Software Protection for FDA Compliance
ICS
 

Último (20)

如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
 
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdfThe Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
 
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptxOperational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
 
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
 
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
 
Boost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management AppsBoost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management Apps
 
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptxMigration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
 
Cost-Effective Strategies For iOS App Development
Cost-Effective Strategies For iOS App DevelopmentCost-Effective Strategies For iOS App Development
Cost-Effective Strategies For iOS App Development
 
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
 
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data PlatformAlluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
 
Orca: Nocode Graphical Editor for Container Orchestration
Orca: Nocode Graphical Editor for Container OrchestrationOrca: Nocode Graphical Editor for Container Orchestration
Orca: Nocode Graphical Editor for Container Orchestration
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
 
Microsoft-Power-Platform-Adoption-Planning.pptx
Microsoft-Power-Platform-Adoption-Planning.pptxMicrosoft-Power-Platform-Adoption-Planning.pptx
Microsoft-Power-Platform-Adoption-Planning.pptx
 
Ensuring Efficiency and Speed with Practical Solutions for Clinical Operations
Ensuring Efficiency and Speed with Practical Solutions for Clinical OperationsEnsuring Efficiency and Speed with Practical Solutions for Clinical Operations
Ensuring Efficiency and Speed with Practical Solutions for Clinical Operations
 
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
 
Streamlining End-to-End Testing Automation
Streamlining End-to-End Testing AutomationStreamlining End-to-End Testing Automation
Streamlining End-to-End Testing Automation
 
Secure-by-Design Using Hardware and Software Protection for FDA Compliance
Secure-by-Design Using Hardware and Software Protection for FDA ComplianceSecure-by-Design Using Hardware and Software Protection for FDA Compliance
Secure-by-Design Using Hardware and Software Protection for FDA Compliance
 

Standing on the Shoulders of Giants – The Kotti Web Application Framework

  • 1. STANDING ON THE SHOULDERS OF GIANTS THE WEB APPLICATION FRAMEWORKKOTTI
  • 2. ANDREAS KAISER |Owner & CTO of Xo7 GmbH Willich, Germany (next to Düsseldorf) | |@diskokaiser disko irc://irc.freenode.net/#kotti
  • 3. THIS TALK Why does Kotti exist? Who are these giants? How are they utilized by Kotti? Example / Code Q&A (if we have time)
  • 4. WHY? YET ANOTHER WEB FRAMEWORK?
  • 5. FEATURES full featured CMS lots of add ons (varying quality) OFS (object file system) security (permissions, roles, groups) workflows
  • 6. Can be a perfect choice when it fits your needs BUT does not fit all kinds of applications.
  • 7.
  • 8.
  • 9. multiple competing technologies doesn't conform to "The Zen of Python" complex
  • 10.
  • 11.  
  • 12.
  • 13. FEATURES small core excellent documentation pythonic low level (micro framework) unopinionated persistence templating / forms authentication / authorization sources “framework framework”
  • 14. CONCLUSION only provides stuff we need doesn't come with unneeded ballast no need to “waste time fighting the framework's decisions” perfect foundation!
  • 15. MAKE SOME CHOICES! persistence traversal or URL dispatch templating & forms authentication & authorization sources
  • 16. probably the most advanced ORM for Python database agnostic has many nice, useful features hybrid properties association proxies ordering list transaction integration with pyramid
  • 17. THE NODE CLASS adjacency list pattern parent children single root node => node tree dictionary protocol
  • 18. THE NODE CLASS DICTIONARY PROTOCOL from kotti.resources import Document from kotti.resources import get_root root = get_root() root['about'] <Document 2 at /about> root['my-document'] = Document(title='My Document', description='foo', body='<p>some HTML</p>')
  • 19. THE NODE CLASS TRAVERSAL a = root['a'] = Document(title='A', description='Document A') b = root['a']['b'] = Document(title='B', description='Document B') c = root['a']['b']['c'] = Document(title='C', description='Document C') Object URL a /a b /a/b c /a/b/c
  • 20. POLIMORPHIC QUERIES from kotti.resources import get_root from kotti.resources import Node root = get_root() print root.children: print(type(c)) "<class 'kotti.resources.Document'>" "<class 'kotti.resources.File'>" print Node.query.filter(Node.title == 'My Document').one() "<Document 5 at /my-document>"
  • 21. JOINED TABLE INHERITANCE class hierarchy is broken up among dependent tables each class represented by its own table the respective table only includes attributes local to that class
  • 23. ALEMBIC DB migrations DDL (transactional, if supported by DBMS) DML environments
  • 24. has all the components for modern UIs responsive well known easy to customize
  • 25. COLANDER define data schema validate & deserialize HTML forms JSON XML serialize Python structures to strings mappings lists
  • 26. DEFORM render HTML forms from structures serialized by Colander outputs Bootstrap 3 forms (Deform 2)
  • 27. a content workflow system states define role / permission mapping transitions define from_state to_state required permission
  • 28. storing and serving files in web applications multiple backends local filesystem S3 GridFS roll your own integrates with SQLAlchemy files are handled like a plain model attribute transaction aware
  • 29. WIRING IT ALL TOGETHER…
  • 30. started by Daniel Nouri in 2011 BSD licensed 1.0.0 in January 2015 current version: 1.1.4 9k downloads per month still small, but active & healthy community contributions are always welcome
  • 31. CODE QUALITY a.k.a. "everyone loves badges" coverage 95% almost Heisenberg quality build passing continuous integration (Python 2.6, 2.7, PostgreSQL, MySQL, SQLite)   code quality A code climate 2.6 issuesissues ­­ 55 2525 3939 static code analysis ( , , ) requirements up­to­date (except 1 testing requirement)Codacy Code Climate QuantifiedCode
  • 32. CONFIGURATION [app:kotti] use = egg:kotti sqlalchemy.url = sqlite:///%(here)s/Kotti.db # sqlalchemy.url = postgres://user:pass@host/db kotti.configurators = kotti_tinymce.kotti_configure kotti_youraddon.kotti_configure [filter:fanstatic] use = egg:fanstatic#fanstatic [pipeline:main] pipeline = fanstatic kotti [server:main] use = egg:waitress#main host = 127.0.0.1 port = 5000
  • 33. EXAMPLE OPTIONS Option Purpose kotti.available_types List of active content types kotti.configurators List of advanced functions for config kotti.root_factory Override Kotti’s default Pyramid root factory kotti.populators List of functions to fill initial database kotti.search_content Override Kotti’s default search function kotti.asset_overrides Override Kotti’s templates kotti.authn_policy_factory Component used for authentication kotti.authz_policy_factory Component used for authorization
  • 34. EXAMPLE OPTIONS (CONTINUED) Option Purpose kotti.caching_policy_chooser Component for choosing the cache header policy kotti.url_normalizer Component used for url normalization kotti.max_file_size Max size for file uploads kotti.depot.*.* Configure the blob storage kotti.sanitizers Configure available sanitizers kotti.sanitize_on_write Configure sanitizers to be used on write access to resource objects
  • 35. SECURITY use SQLAlchemy to… store pricipals (users & groups) in the DB attach (inheritable) ACLs to each node use Pyramid for… authentication authorization use repoze.workflow to… recompute ACLs on workflow state changes
  • 36. EXAMPLE CREATING AN ADDON $ pcreate -s kotti kotti_myaddon Author name [Andreas Kaiser]: Author email [disko@binary-punks.com]: Github username [Kotti]: [… lot of output …] =============================================================================== Welcome to Kotti! Documentation: http://kotti.readthedocs.org/ Development: https://github.com/Kotti/Kotti/ Issues: https://github.com/Kotti/Kotti/issues?state=open IRC: irc://irc.freenode.net/#kotti Mailing List: https://groups.google.com/group/kotti ===============================================================================
  • 37. CUSTOM CONTENT TYPE from kotti.resources import Content from sqlalchemy import * class Document(Content): id = Column(Integer(), ForeignKey('contents.id'), primary_key=True) body = Column(UnicodeText()) mime_type = Column(String(30)) type_info = Content.type_info.copy( name=u'Document', title=_(u'Document'), add_view=u'add_document', addable_to=[u'Document'])
  • 38.
  • 39. SCHEMA DEFINITION FOR VALIDATION AND FORM CREATION import colander import deform from kotti.views.edit.content import ContentSchema class DocumentSchema(ContentSchema): body = colander.SchemaNode( colander.String(), title=_(u'Body'), widget=deform.widget.RichTextWidget(), missing=u"")
  • 40. ADD / EDIT FORMS from kotti.resources import Document from kotti.views.form import AddFormView from kotti.views.form import EditFormView from pyramid.view import view_config @view_config(name=Document.type_info.add_view, permission='add', renderer='kotti:templates/edit/node.pt') class DocumentAddForm(AddFormView): schema_factory = DocumentSchema add = Document item_type = _(u"Document") @view_config(context=Document, name='edit', permission='edit', renderer='kotti:templates/edit/node.pt') class DocumentEditForm(EditFormView): schema_factory = DocumentSchema
  • 41.
  • 42.
  • 43. VIEW(S) from pyramid.view import view_config @view_config(name='view', context=Document, permission='view', renderer='kotti:templates/view/document.pt') def document_view(context, request): return {} OR from pyramid.view import view_config from pyramid.view import view_defaults from kotti.views import BaseView @view_defaults(context=Document, permission='view') class DocumentViews(BaseView): @view_config(name='view', renderer='kotti:templates/view/document.pt') def view(self): return {} @view_config(name='view2', renderer='kotti:templates/view/document2.pt') def view(self): return {'answer': 42} @view_config(name='json', renderer='json') def view(self): return {'title': self.context.title, 'body': self.context.body, ...} # return self.context
  • 44. TEMPLATE(S) <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" metal:use-macro="api.macro('kotti:templates/view/master.pt')"> <article metal:fill-slot="content" class="document-view content"> <h1>${context.title}</h1> <p class="lead"> ${context.description} </p> <div tal:replace="api.render_template('kotti:templates/view/tags.pt')" /> <div class="body" tal:content="structure context.body | None"> </div> </article> </html>
  • 45.
  • 46. THE FUTURE will always stay “lean and mean in all of the right ways” Python 3 support