2589
說明: 加入 Django 介紹
|
← 2023-01-08 22:40:20 修訂第 42 版 ⇥
4519
|
這個顏色代表刪除的 | 這個顏色代表增加的 |
行號 1: | 行號 1: |
<<TableOfContents()>> |
|
行號 2: | 行號 4: |
如果你是 [[Python]] 初學者,可先參考 [[Python/第一次用就上手]]。 | |
行號 3: | 行號 6: |
如果你對 Python 不熟,可先參考 [[Python/第一次用就上手]]。 | 如果你是網站開發(Web Development)初學者,可參考 Wikipedia 上的[[http://zh.wikipedia.org/wiki/Category:網頁技術|分類:網頁技術]]、[[http://zh.wikipedia.org/zh-tw/Category:網站開發|分類:網站開發]],或用關鍵字「HTML CSS Javascript」搜尋相關資料;當然,這只是網站開發的冰山一角。 |
行號 9: | 行號 12: |
== 沒有廢話直接開始 == [[http://djangogirlstaipei.herokuapp.com/tutorials/|Django Girls 教學手冊 - Django Girls Taipei]] |
|
行號 10: | 行號 16: |
* [[Django]] 目前為最大宗。 * Flask(應該是 Pyhton Web Framework 在 Github 上 star 最多的,也就是說,人氣很旺) * Pyramid ([[Pylons Project]])(如果你才剛學 Python,不要用!) * web2py * bottle.py * [[Zope]] & [[Plone]](要架 CMS 可以考慮 Plone) |
|
行號 11: | 行號 23: |
第一大宗是 Django(/ˈdʒæŋɡoʊ/ jang-goh,[[http://blog.ianbicking.org/2007/08/02/pronouncing-django/|d 不發音|target="_blank"]])。 謫自[[http://zh.wikipedia.org/zh-tw/Django|Wikipedia 上的 Django 條目|target="_target"]]的簡介: |
== 相對小眾的 Python 網站框架 == * TurboGears * web.py |
行號 14: | 行號 27: |
Django 是一個開放原始碼的 Web 應用框架,由 Python 寫成。採用了 MVC 的軟體設計模式,即模型 M,視圖 V 和控制器 C。... 主要目標是使得開發複雜、資料庫驅動的網站變得簡單。它注重組件的重用性和「可插拔性」,敏捷開發和 DRY 法則(Don't Repeat Yourself)。 | == 有名的一行文 Python Web Server == * ``python2 -m SimpleHTTPServer`` * ``python3 -m http.server`` |
行號 16: | 行號 31: |
* [[http://blog.eddie.com.tw/2011/10/14/django-introduction/|Django簡介|target="_blank"]] by 高見龍,2011.10 註:該格落格有[[http://blog.eddie.com.tw/category/django/|一系列的 Django 文|target="_blank"]]可參考。 * [[http://blog.ericsk.org/archives/815|用 Python + django 10分鐘內作出一個 blog|target="_blank"]] by Eric Shangkuan,2007 * [[http://tech.seety.org/python/django_tossug_present.html|Django, how to start|target="_blank"]] by [[yungyun]],2006 * [[http://www.openfoundry.org/tw/tech-column/8564-python-django-on-heroku|Python/Django on Heroku|target="_blank"]] by 小梅,2012.01 註:直接上雲端的佈署文。 |
== 別忘了學會問問題、找答案 == 見 [[Python/請教問題或FAQ的地方]] == 熱血的教學文 == * [[http://drweb.nksh.tp.edu.tw/student/lessons/C/|Django 教學網頁(含教學影片)]] by 高慧君 2017.1 (目前完成的部份,是從第7堂課開始) * [[http://dokelung-blog.logdown.com/posts/235592-django-notes-table-of-contents|Django筆記 - 目錄 « dokelung's Blog]] 2014.10 * [[http://www.slideshare.net/lemonlatte/web-develop-in-flask|Web develop in flask]] by Jim Yeh, 2014.10 |
行號 22: | 行號 40: |
* [[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 |
|
行號 23: | 行號 47: |
[[http://learnpythonthehardway.org/book/|"Learn Python The Hard Way" by Zed A. Shaw|target="_blank"]] 的 execise 50、51 及 52 教你如何加入寫網站應用程式(Web Application)的世界 | * [[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." == 進階文章 == * [[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." |
行號 26: | 行號 56: |
僅供參考: | |
行號 27: | 行號 58: |
初學者僅供參考: | [[Thinker]] 的[[http://pastebin.com/yzy0TjRn|手刻四行 hello world]]: |
行號 29: | 行號 60: |
[[Thinker]] 的[[http://pastebin.com/yzy0TjRn|手刻四行 hello world|target="_blank"]]: {{{#!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() |
行號 37: | 行號 62: |
註:行數通常不是選擇 Web Framework 的條件;但少行勝多行也是很棒的一點。 |
註:行數通常不是選擇 Web Framework 的條件;但少行勝多行還是很棒。 |
目 錄
如何開始寫網站應用程式(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
相對小眾的 Python 網站框架
- web.py
有名的一行文 Python Web Server
python2 -m SimpleHTTPServer
python3 -m http.server
別忘了學會問問題、找答案
熱血的教學文
Django 教學網頁(含教學影片) by 高慧君 2017.1 (目前完成的部份,是從第7堂課開始)
Django筆記 - 目錄 « dokelung's Blog 2014.10
Web develop in flask by Jim Yeh, 2014.10
參考資料
Web Frameworks for Python Python 官網 http://wiki.python.org 上的參考資料。
"Learn Python The Hard Way" by Zed A. Shaw 的 execise 50、51 及 52 教你如何加入寫網站應用程式(Web Application)的世界
- 關於網站框架的熱門度參考:
Let’s Build A Web Server. Part 1. - Ruslan's Blog 畫的圖很有趣明白。2015.03.09
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."
進階文章
Sewing Success with Fabric by Dustin Lacewell,2011.12.28
- "a quick practical example of how Fabric, can make your development life easier."
禁(?)技
僅供參考:
註:行數通常不是選擇 Web Framework 的條件;但少行勝多行還是很棒。