Skip to content. | Skip to navigation

Personal tools

Navigation

You are here: Home / Tips / Web Framework

Web Framework

網站開發框架 (Web Framework) 目的是為了簡化開發過程的常見工作,包括提供 template、caching、security、database access、Object-Relational Mapping、URL mapping、AJAX、Web services 等。
$ curl -i -H "Accept: application/json" -H "Content-type: appication/json" --data-raw '{"@type":"Document", "title": "My Document"}' --user admin:mypass -X POST http://140.109.161.61:8080/mysite/my-folder
HTTP/1.1 201 Created
Server: Zope/(2.13.24, python 2.7.12, linux2) ZServer/1.1
Date: Sun, 11 Sep 2016 00:30:38 GMT                                                                                     Content-Length: 4
Content-Type: application/json                                                                                          Location: http://140.109.161.61:8080/mysite/my-folder/my-document

Deployment on Google App Engine (GAE)

Comparison

Headless CMS

Lennart Regebro: Zope/Plone 預設使用 Traversal 網址機制,這在 CMS 場合好用,但在其他場合 URL Dispatch 可能比較合適。像 Django 使用 URL Reverse Resolution 機制,目標是做到 Don't Repeat Yourself。像 Pyramid 則兩種都提供,所以不被限制。早期 Django 使用 Function-based View 後來改成 Class-based View

Nate Aune: When Not to Use Plone Additive vs Subtractive 增加 CMS 相關功能並不是太難的事,但拿掉 Plone 不必要的功能,通常會花更大力氣。

Joel Spolsky: a Platform Needs to Appeal to Developers First and Foremost, Not End Users, Needs to Be Marketed In a Different Way to Be Successful.

Jason Huggins: Zope vs Django Paul Everritt: Python, Web Frameworks, Acts of Good Faith, Making the Case

Sanic: Flask like, with native async features

Falcon 類似 Flask 但效能快5倍; FastAPI django-fastapi

Plone 本身是 CMS Product 在 Application Development 場合就容易產生開發和效能的干擾。

Performance Benchmark Go vs Vapor (Swift) OpenResty is a full-fledged web platform that integrates our enhanced version of the Nginx core, our enhanced version of LuaJIT, many carefully written Lua libraries, lots of high quality 3rd-party Nginx modules, and most of their external dependencies. It is designed to help developers easily build scalable web applications, web services, and dynamic web gateways.

The Great Web Framework Shootout Beginner Introduction

BFG Migrating to Pyramid Ray Framework

Porting from TurboGear to Django

Pyramid vs NodeJS vs Gevent Apostrophe CMS

Ryan Brown: Django vs Flask vs Pyramid Flask vs. Django vs. Pyramid vs. Plone

Dylan Jay: Django, Pyramid, Plone PyCon Australia 2013 Kiwi PyCon 2013

Python and Django Learning Path

Why PHP Is Fun and Easy But Python Is Marriage Material PHP: a fractal of bad design PHP: The Wrong Way PHP 史上知名的安全範例: register_globals, magic_quotes, and session IDs in the query string

What Will pypy Do for Your Website Benchmarking

14 Minimal Web Frameworks for Python Rookeries: PostgreSQL + React, Redux, ES6, LESS flask basic tutorial REST API comparison Docker + Flask REST

1.0 的釋出時間? 1.3 處理了 Python 3 的相容議題,更換了 paster 和 waitress

潘俊勇 框架分類

微型: web.py, flask,  bottle, web2py (comparison by Richard Jones)

中型: pyramid, turbogears

重型: zope, django, plone

即時: twisted, tornado, gevent

女怕嫁錯郎,男怕入錯行,web 程式員怕選錯框。

Great Web Framework Shootout Article by OpenStack Heat Developer

Template Engine: Jinja, Mako

Evaluating QuerySet Repeatedly in the Django Shell

Pyramid

具備精簡、快速、高度可靠的特性。

http://pigeonflight.blogspot.tw/2011/10/weekend-project-image-thumbnailer-day-1.html

http://docs.pylonsproject.org/projects/pyramid_cookbook/en/latest/deployment/gevent.html

Tween 是 Pyramid 的中介軟體,類似 WSGI 角色,可操作全域註冊表。

Dylan Jay, PyCon Australia 2011

Carlos de la Guardia, Writing a Pyramid Application

Tim Knapp: Pyramid GAE Kiwi PyCon 2013

Flask

Harvard 2017 CS50 Web App with Flask Uploading Files One to Many Relationships with Flask-SQLAlchemy

http://www.youtube.com/watch?v=CjYKrbq8BCw Flask RESTful

Morepath

Server Templating

MVC

Java MVC 早期採用 SSH (Struts, Spring, Hibernate) 在 2014 後 Spring Boot 延續 Spring 4.0 核心 導入 REST 和簡化 XML 設定 成為後起之秀

MTV RV

Testing

Seamless Integration of JavaScript Code in Plone Buster.js

Asynchronus IO

先認識處理大量訊息的方式,參考範例,再參考 Asynchronous HTTP Request aiohttp 範例。

gevent 是一個網路函式庫,特色是搭配 libevent 提供非同步 API,它的核心由 Greenlet 實作完成,是一個輕量級的 coroutine。

PyCon sprint with gevent, socket io, redis, django gevent.monkey.patch_all

plone.app.async: Override the Default User

Related content
Build Web Apps Having Fun