Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Morepath Introduction at PyZurich
Search
Denis Krienbühl
March 02, 2016
Technology
110
0
Share
Morepath Introduction at PyZurich
An introduction to Morepath, the web microframework with super powers.
Denis Krienbühl
March 02, 2016
Other Decks in Technology
See All in Technology
AI時代の品質はテストプロセスの作り直し #scrumniigata
kyonmm
PRO
4
1.4k
Anthropic「Long-running a gents」をGeminiで再現してみた
tkikuchi
0
790
『生成AI時代のクレデンシャルとパーミッション設計 — Claude Code を起点に』の執筆企画
takuros
3
2.2k
Vision Banana: Image Generators are Generalist Vision Learners
kzykmyzw
0
290
国内外の生成AIセキュリティの最新動向 & AIガードレール製品「chakoshi」のご紹介 / Latest Trends in Generative AI Security (Domestic & International) & Introduction to AI Guardrail Product "chakoshi"
nttcom
4
2.1k
変化の激しい時代をゴキゲンに生き抜くために 〜ストレスマネジメントのススメ〜
kakehashi
PRO
4
1.1k
Building a Study Buddy AI Agent from Scratch: From Passive Chatbots to Autonomous Systems
itchimonji
0
140
QAエンジニアはどうやって プロダクト議論の場に入れるのか?
moritamasami
2
410
「誰一人取り残されない」 AIエージェント時代のプロダクト設計思想 Product Management Summit 2026
mizushimac
1
3k
AIエージェントの支払い基盤 AgentCore Payments概要
kmiya84377
1
130
エンタープライズの厳格な制約を開発者に意識させない:クラウドネイティブ開発基盤設計/cloudnative-kaigi-golden-path
mhrtech
0
310
AIが盛んな時代に 技術記事を書き始めて起きた私の中での小さな変化
peintangos
0
360
Featured
See All Featured
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
110
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
190
Git: the NoSQL Database
bkeepers
PRO
432
67k
Raft: Consensus for Rubyists
vanstee
141
7.4k
Test your architecture with Archunit
thirion
1
2.2k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.7k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
199
73k
Everyday Curiosity
cassininazir
0
200
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Prompt Engineering for Job Search
mfonobong
0
290
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
210
Transcript
Morepath! Sheesh, another web-framework? is this #jszurich or what?
Why not Morepath?
I am Morepath contributor #2* *with 38 out of 999
commits
So what is Morepath? A web micro-framework with superpowers!
• First commits in 2013 • Created by Martijn Faassen
• LXML • Fanstatic • Zope Morepath History
• Morepath is a child of Zope • Pyramid is
a child of Zope Morepath Lineage
Features that set it apart. • Change/extend all the things.
• Change/extend all the things. • Models and views separated.
Features that set it apart.
• Change/extend all the things. • Models and views separated.
• Paths are first class citizens. Features that set it apart.
• Change/extend all the things. • Models and views separated.
• Paths are first class citizens. • REST first. Features that set it apart.
Boooring! Let’s look at some code!
Defining an App import morepath class App(morepath.App): pass
Defining a Model class Page(object): def __init__(self, id, title): self.id
= id self.title = title
Defining a Path @App.path(path='page/{id}', model=Page) def get_page(id): return Page(id) /page/about
/a/file
Defining a View @App.html(model=Page) def view_page(self, request): return ‘<p>%s</p>’ %
self.title @App.json(model=Page) def view_page(self, request): return {‘title’: self.title} or
import morepath class App(morepath.App): pass class Page(object): def __init__(self, id,
title): self.id = id self.title = title @App.path(path='page/{id}', model=Page) def get_page(id): return Page(id, title=id) @App.html(model=Page) def view_page(self, request): return ‘<p>%s</p>’ % self.title This totally fits
Extensibility No more pull requests!
No More Pull Requests from someblog import App, Page, get_page
class MyApp(App): pass @MyApp.path(path='page/{id}', model=Page) def get_my_page(id): if id == 'portfolio': return Page(id='portfolio', title=…) return get_page(id) /page/portfolio
My HTML > Your HTML from someblog import App, Post,
view_post class MyApp(App): pass @MyApp.html(model=Post, template=‘custom.pt’) def my_view_post(self, request): return view_post(self, request)
But I *need* this from someblog import App, Post class
MyApp(App): pass @MyApp.html(model=Post, name='extra') def my_extra_view(self, request): … /post/morepath-rocks/extra
Links The best thing since sliced bread
How Others Link @app.route('pages/{id}', name='pages_route') … request.link(‘pages_route’, id=page.id)
How It Should Be Done @app.path(path='/pages/{id}', model=Page) … request.link(my_page)
Models, Views A case for separation
How Others Do It @app.route('/pages/{id}') def view_page(request, id): page =
query_page(request, id) if page is None: raise HTTPNotFound() return {'title': page.title}
How It Should Be Done @App.path(‘/pages/{id}’, model=Page) def get_page(request, id=0):
return query_page(request, id) @App.json('/pages/{id}') def view_page(self, request): return {'title': self.title}
• Inherit all the views. Model View Separation !
• Inherit all the views. • Write generic views. Model
View Separation !
• Inherit all the views. • Write generic views. •
Very easy to add a REST API. Model View Separation !
More Features OMG!
• Override core Morepath. Amuse-buche
• Override core Morepath. • Model driven permissions. Amuse-buche
• Override core Morepath. • Model driven permissions. • Exception
views. Amuse-buche
• Override core Morepath. • Model driven permissions. • Exception
views. • Link to other applications. Amuse-buche
• Override core Morepath. • Model driven permissions. • Exception
views. • Link to other applications. • Mount other applications. Amuse-buche
The State of Morepath World dominance or else!
The End morepath.readthedocs.org
[email protected]
@href_ speakerdeck.com/href/morepath-introduction-at-pyzurich