極簡的純Python web框架:ObjectWeb

jopen 9年前發布 | 10K 次閱讀 ObjectWeb Web框架

ObjectWeb 是一個快速,極簡的純Python web框架,不依賴任何的第三方庫。它圍繞Python進行設計,因為起初想要把它當做面向對象的編程語言來使用。ObjectWeb支持CGI和WSGI標準,而且有一個內建的開發服務器。 

特性
import ObjectWeb  # import the library.

class MainPage(object): # Any object can be a handler
    "The main page handler."

    def GET(self):
        "The GET method handler."
        return "Output content here..."

    # Make the POST method mimic the GET method.
    POST = GET

# Create the Application Object.
app = ObjectWeb.Application([
    ("/", MainPage),              # Point the / path to be handled by MainPage
], debug=False)                   # Set debug to False for production.

  • Pure Python 2.6/2.7 with reliance on third party libraries.
  • Supports CGI and WSGI standards. (&& Google App Engine... Maybe.)
  • A nice debug feature to help with 500 Internal Errors.
  • Allows the use of external libraries without interfering.
  • Map your URLS to request paths using regular expressions.
  • Easily extract information from the request.
  • Form API - form processing and validation module.
  • Built-in development server.


項目主頁:http://www.baiduhome.net/lib/view/home/1426559844211

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!