Python@TW: 會眾| IRC| Planet| 郵件列表| 聯絡我們
修訂版 25 和 26 的差異如下:
2015-04-11 08:35:32 修訂第 25 版
大小: 4565
編輯者: keitheis
說明:
2016-06-07 17:39:41 修訂第 26 版
大小: 4348
編輯者: 112-104-69-12
說明:
這個顏色代表刪除的 這個顏色代表增加的
行號 2: 行號 2:
行號 3: 行號 4:
行號 6: 行號 6:
如果你是網站開發(Web Development)初學者,可參考 Wikipedia 上的[[http://zh.wikipedia.org/wiki/Category:%E7%B6%B2%E9%A0%81%E6%8A%80%E8%A1%93|分類:網頁技術|target="_blank"]]、[[http://zh.wikipedia.org/zh-tw/Category:%E7%B6%B2%E7%AB%99%E9%96%8B%E7%99%BC|分類:網站開發|taget="_blank"]],或用關鍵字「HTML CSS Javascript」搜尋相關資料;當然,這只是網站開發的冰山一角。 如果你是網站開發(Web Development)初學者,可參考 Wikipedia 上的[[http://zh.wikipedia.org/wiki/Category:網頁技術|分類:網頁技術]]、[[http://zh.wikipedia.org/zh-tw/Category:網站開發|分類:網站開發]],或用關鍵字「HTML CSS Javascript」搜尋相關資料;當然,這只是網站開發的冰山一角。
行號 13: 行號 13:
行號 17: 行號 16:
行號 26: 行號 24:

* [[TurboGears]]
 * TurboGears
行號 31: 行號 28:
行號 39: 行號 35:
行號 44: 行號 39:
 * [[http://tech.mozilla.com.tw/posts/2390/想學-pythondjango-就從-mozilla-網站專案開始吧!|想學 Python/Django? 就從 Mozilla 網站專案開始吧! - Mozilla Tech - 謀智台客]]
 * [[http://wiki.python.org/moin/WebFrameworks|Web Frameworks for Python]] Python 官網 http://wiki.python.org 上的參考資料。
 * [[http://learnpythonthehardway.org/book/|"Learn Python The Hard Way" by Zed A. Shaw]] 的 execise 50、51 及 52 教你如何加入寫網站應用程式(Web Application)的世界
 * 關於網站框架的熱門度參考:
  * [[http://www.quora.com/Python-Web-Frameworks/What-is-the-ratio-of-projects-using-Django-compared-to-other-Python-frameworks-Pylons-Pyramid-Flask-Tornado-etc-Is-where-statistic-about-percentage-of-Django-based-projects|Python Web Frameworks: What is the ratio of projects using Django compared to other Python frameworks (Pylons/Pyramid/Flask/Tornado/etc.). Is where statistic about percentage of Django based projects? - Quora]],2011.12
  * [[http://www.bryceboe.com/2011/02/21/using-stackoverflows-api-to-find-the-top-web-frameworks/|Using StackOverflow’s API to Find the Top Web Frameworks]] by Bryce Boe,2011.02
行號 45: 行號 46:
 * [[http://tech.mozilla.com.tw/posts/2390/想學-pythondjango-就從-mozilla-網站專案開始吧!|想學 Python/Django? 就從 Mozilla 網站專案開始吧! - Mozilla Tech - 謀智台客]]
 * [[http://wiki.python.org/moin/WebFrameworks|Web Frameworks for Python|target="_blank"]] Python 官網 http://wiki.python.org 上的參考資料。
 * [[http://learnpythonthehardway.org/book/|"Learn Python The Hard Way" by Zed A. Shaw|target="_blank"]] 的 execise 50、51 及 52 教你如何加入寫網站應用程式(Web Application)的世界
 * 關於網站框架的熱門度參考:
    * [[http://www.quora.com/Python-Web-Frameworks/What-is-the-ratio-of-projects-using-Django-compared-to-other-Python-frameworks-Pylons-Pyramid-Flask-Tornado-etc-Is-where-statistic-about-percentage-of-Django-based-projects|Python Web Frameworks: What is the ratio of projects using Django compared to other Python frameworks (Pylons/Pyramid/Flask/Tornado/etc.). Is where statistic about percentage of Django based projects? - Quora|target="_blank"]],2011.12
    * [[http://www.bryceboe.com/2011/02/21/using-stackoverflows-api-to-find-the-top-web-frameworks/|Using StackOverflow’s API to Find the Top Web Frameworks|target="_blank"]] by Bryce Boe,2011.02

 * [[http://ruslanspivak.com/lsbaws-part1/|Let’s Build A Web Server. Part 1. - Ruslan's Blog]] 畫的圖很有趣明白。2015.03.09
 * [[http://pyrseas.wordpress.com/2011/12/29/python-web-frameworks-development-server/|Python Web Frameworks - Development Server|target="_blank"]] on Taming Serpents and Pachyderms,2011.12.29
  "Lesson for prospective framework creators: Don't write your own server. However, you may want to enhance your server with auto-reloading, threading, debugging. etc."
 * [[http://ruslanspivak.com/lsbaws-part1/|Let’s Build A Web Server. Part 1. - Ruslan's Blog]] 畫的圖很有趣明白。2015.03.09
 * [[http://pyrseas.wordpress.com/2011/12/29/python-web-frameworks-development-server/|Python Web Frameworks - Development Server]] on Taming Serpents and Pachyderms,2011.12.29
  . "Lesson for prospective framework creators: Don't write your own server. However, you may want to enhance your server with auto-reloading, threading, debugging. etc."
行號 57: 行號 51:

* [[www.chicagodjango.com/blog/sewing-success-fabric/|Sewing Success with Fabric|target="_blank"]] by Dustin Lacewell,2011.12.28
  "a quick practical example of how Fabric, can make your development life easier."
 * [[www.chicagodjango.com/blog/sewing-success-fabric/|Sewing Success with Fabric]] by Dustin Lacewell,2011.12.28
  . "a quick practical example of how Fabric, can make your development life easier."
行號 62: 行號 55:
行號 65: 行號 57:
[[Thinker]] 的[[http://pastebin.com/yzy0TjRn|手刻四行 hello world|target="_blank"]]: [[Thinker]] 的[[http://pastebin.com/yzy0TjRn|手刻四行 hello world]]:
行號 67: 行號 59:
{{{#!python
import BaseHTTPServer
class handler(BaseHTTPServer.BaseHTTPRequestHandler): pass
handler.do_GET = lambda x: x.wfile.write('Hello world')
BaseHTTPServer.HTTPServer(('', 8000), handler).serve_forever()
{{{#!python   import BaseHTTPServer  class handler(BaseHTTPServer.BaseHTTPRequestHandler): pass  handler.do_GET = lambda x: x.wfile.write('Hello world')  BaseHTTPServer.HTTPServer(('', 8000), handler).serve_forever()
行號 73: 行號 61:

如何開始寫網站應用程式(Web Application)

如果你是 Python 初學者,可先參考 Python/第一次用就上手

如果你是網站開發(Web Development)初學者,可參考 Wikipedia 上的分類:網頁技術分類:網站開發,或用關鍵字「HTML CSS Javascript」搜尋相關資料;當然,這只是網站開發的冰山一角。

通常你可以針對自身的需求、佈署環境、工作環境與團隊來比較各個網站框架(Web Framework),挑一個適合你的選擇。就算真的沒有符合你需求的,自己動手寫一個也不會太難。這也許是人說:「Python 的 Web Framework 比它的關鍵字還多。」的原因。

如果你只是想試一試,沒有什麼需求可言,那就隨便挑一個順眼的。

沒有廢話直接開始

Django Girls 教學手冊 - Django Girls Taipei

有名的 Python 網站框架

  • Django 目前為最大宗。

  • Flask(應該是 Pyhton Web Framework 在 Github 上 star 最多的,也就是說,人氣很旺)
  • Pyramid (Pylons Project)(如果你才剛學 Python,不要用!)

  • web2py
  • bottle.py
  • Zope & Plone(要架 CMS 可以考慮 Plone)

相對小眾的 Python 網站框架

有名的一行文 Python Web Server

  • python2 -m SimpleHTTPServer

  • python3 -m http.server

別忘了學會問問題、找答案

Python/請教問題或FAQ的地方

熱血的教學文

參考資料

進階文章

  • Sewing Success with Fabric by Dustin Lacewell,2011.12.28

    • "a quick practical example of how Fabric, can make your development life easier."

禁(?)技

僅供參考:

Thinker手刻四行 hello world:

   1 

註:行數通常不是選擇 Web Framework 的條件;但少行勝多行還是很棒。

Python/第一次寫Web就上手 (上次是 58-115-33-84 在 2023-01-08 22:40:20 編輯的)