【正文】
RequestHeader Authorization 。 引用頁面的 URI | UserAgent 。及很多不常用的操作系統(tǒng),包括 AIX、 AS/400 OS/400 、 BeOS、 OS/ OS/390 與 z/OS、 Palm OS、 PlayStation 與 PSP、 Psion、QNX、 RISC OS、 Series 60、 Sparc Solaris、 VMS、 VxWorks、 Windows CE 或 Pocket PC、 Sharp Zaurus、 MorphOS 等。 Python可以使用戶避免過分的語法的羈絆而將精力主要集中到所要實現(xiàn)的程序任務(wù)上。采用了 MVC 的設(shè)計模式,即模型 M,模版 T 和視圖控制器 V。 Django 的主要目標(biāo)是使得開發(fā)復(fù)雜的、數(shù)據(jù)庫驅(qū)動的網(wǎng)站變得簡單。 Django 框架的核心包括:一個 對象 關(guān)系 的映射器,用作數(shù)據(jù)模型(以Python 類的形式定義)和關(guān)系數(shù)據(jù)庫間的媒介;一個基于正則表達式的 URL 分發(fā)器;一個視圖系統(tǒng),用于處理請求;以及一個模板系統(tǒng)。 中間件支持,允許對請求處理的各個階段進行干涉。 Django 包含了很多應(yīng)用在它的“ contrib”包中,這些包括: 一個可擴展的認(rèn)證系統(tǒng) 動態(tài)站點管理頁面 一組產(chǎn)生 RSS 和 Atom 的工具 一個靈活的評論系統(tǒng) 產(chǎn)生 Google 站點地圖 Google Sitemaps 的工具 防止跨站請求偽造( crosssite request fery)的工具 一套支持輕量級標(biāo)記語言( Textile 和 Markdown)的模板庫 一套協(xié)助創(chuàng)建地理信息系統(tǒng)( GIS)的基礎(chǔ)框架 SQLite 數(shù)據(jù)庫簡介 SQLite 是遵守 ACID 的關(guān)聯(lián)式數(shù)據(jù)庫管理系統(tǒng),它包含在一個相對小的 C 庫中。這在消耗總量、延遲時間和整體簡單性上有積極的作用。不進行類型檢查。 多個進程或線程可以訪問同一個數(shù)據(jù)而沒有問題。 它也充當(dāng)寫使用 SQLite 庫的應(yīng)用的一個例子 第 3 章 需求分析 系統(tǒng)描述 網(wǎng)站流量統(tǒng)計系統(tǒng)包括三個基本部分,一個是記錄訪客部分,包括記錄訪客的 IP 地址,瀏覽器信息,操作系統(tǒng)信息,瀏覽時間, 離開時間,瀏覽頁面,會話記錄。每個網(wǎng)站都由系統(tǒng)生成唯一的編號,通過讓不同的網(wǎng)站引用名為該網(wǎng)站編號的圖片,就能區(qū)分出是來自哪個網(wǎng)站的訪客。通過它不僅能區(qū)分訪客訪問什么頁面,還能判斷是否是屬于某網(wǎng)站域名下的 URL,以過濾第三方引用圖片造成的 Request。 停留時間 Http 是一個無狀態(tài)協(xié)議,同一個會話的連續(xù)兩個請求互相不了解,他們由最新實例化的環(huán)境進行解析,除了應(yīng)用本身可能已經(jīng)存儲在全局對象 中的所有信息外,該環(huán)境不保存有會話有關(guān)的任何信息。 圖 數(shù)據(jù)庫結(jié)構(gòu)關(guān)系示意圖 統(tǒng)計服務(wù)器從瀏覽器客戶端的 Request 中獲取 HTTP_USER_AGENT,REMOTE_ADDR, HTTP_REFERER。 圖 登錄頁面 超級用戶頁面 超級用戶能對所有用戶,用戶組,網(wǎng)站,訪客數(shù)據(jù)進行所有權(quán)限管理。 圖 網(wǎng)站管理頁面 訪客信息 訪客中包含訪客的 IP,瀏覽器,操作系統(tǒng),訪問時間,離開時間。 圖 用戶管理頁面 圖 用戶修改頁面 用戶組管理 用戶組管理只有超級用戶用戶才能訪問,可以添加刪除用戶組,及修改用戶組的對各個表的操作權(quán)限。 圖 綜合統(tǒng)計報告 計報告 統(tǒng)計某日內(nèi)的以小時為單位的 pv, uv, ip 總數(shù)。 鏈接測試可以自動進行,現(xiàn)在已經(jīng)有許多工具可以采用。例如:用戶填寫的出生日期與職業(yè)是否恰當(dāng),填寫的所屬省份與所在城市是否匹配等 。 cookies 測試 cookies 通常用來存儲用戶信息和用戶在某應(yīng)用系統(tǒng)的操作,當(dāng)一個用戶使用 cookies 訪問了某一個應(yīng)用系統(tǒng)時, web 服務(wù)器將發(fā)送關(guān)于用戶的信息,把該信息以 cookies 的形式存儲在客戶端計算機上,這可用來創(chuàng)建動態(tài)和自定義頁面或者存儲登陸等信息。當(dāng)在分布式環(huán)境中開發(fā)時,開發(fā)人員都不在一起,這個問題就顯得尤為重要。 在使用了數(shù)據(jù)庫的 web 應(yīng)用系統(tǒng)中,一般情況下,可能發(fā)生兩種錯誤,分別是數(shù)據(jù)一致性錯誤和輸出錯誤。如果 web 系統(tǒng)響應(yīng)時間太長(例如超過 5 秒鐘),用戶就會因沒有耐心等待而離開。負(fù)載級別可以是某個時刻同時訪問 web 系統(tǒng)的用戶數(shù)量,也可以是在線數(shù)據(jù)處理的數(shù)量。壓力測試是測試系統(tǒng)的限制和故障恢復(fù)能力,也就是測試 web 應(yīng)用系統(tǒng)會不會崩潰,在什么情況下會崩潰。通過考慮下列問題,可以決定一個 web 應(yīng)用系統(tǒng)是否易于導(dǎo)航:導(dǎo)航是否直觀? web 系統(tǒng)的主要部分是否可通過主頁存取? web 系統(tǒng)是否需要站點地圖、搜索引擎或其他的導(dǎo)航幫助? 在一個頁面上放太多的信息往往起到與預(yù)期相反的效果。確保用戶憑直覺就知道 web 應(yīng)用系統(tǒng)里面是否還有內(nèi)容,內(nèi)容在什么地方。圖形測試的內(nèi)容有: 要確保圖形有明確的用途,圖片或動畫不要胡亂地堆在一起,以免浪費傳輸時間。 圖片的大小和質(zhì)量也是一個很重要的因素,一般采用 jpg 或 gif 壓縮。這種測試通常使用一些文字處理軟件來進行,例如使用 microsoft word 的“拼音與語法檢查”功能;信息的相關(guān)性是指是否在當(dāng)前頁面可以找到與當(dāng)前瀏覽信息相關(guān)的信息列表或入口,也就是一般 web 站點中的所謂“相關(guān)文章列表”。 對所有的可用性測試來說,都需要有外部人員(與 web 應(yīng)用系統(tǒng)開發(fā)沒有聯(lián)系或聯(lián)系很少的人員)的參與,最好是最終用戶的參與。 經(jīng)過一段時間的開發(fā)與測試,網(wǎng)站流量統(tǒng)計系統(tǒng)已經(jīng)基本完成。 由于開始時對系統(tǒng)缺乏整體認(rèn)識,不具備軟件開發(fā)思想,對系統(tǒng)的功能需求分析的要求認(rèn)識不夠清楚,使得后續(xù)的工作不得不經(jīng)常返回去修改數(shù)據(jù)表和個別代碼。 總之,通過這次 設(shè)計 ,我深刻體會到要做好一個完整的事情,需要有系統(tǒng)的思維方式和方法,對待一個新的問題,要耐心、要善于運用已有的資源來充實自己。q The TE header field only applies to the immediate connection. Therefore, the keyword MUST be supplied within a Connection header field section whenever TE is present in an HTTP/ message. A server tests whether a transfercoding is acceptable, according to a TE field, using these rules: 1. The chunked transfercoding is always acceptable. If the keyword trailers is listed, the client indicates that it is willing to accept trailer fields in the chunked response on behalf of itself and any downstream clients. The implication is that, if given, the client is stating that either all downstream clients are willing to accept trailer fields in the forwarded response, or that it will attempt to buffer the response on behalf of downstream recipients. Note: HTTP/ does not define any means to limit the size of a chunked response such that a client can be assured of buffering the entire response. 2. If the transfercoding being tested is one of the transfercodings listed in the TE field, then it is acceptable unless it is acpanied by a qvalue of 0. As defined in section , a qvalue of 0 means not acceptable. 3. If multiple transfercodings are acceptable, then the acceptable transfercoding with the highest nonzero qvalue is preferred. The chunked transfercoding always has a qvalue of 1. If the TE fieldvalue is empty or if no TE field is present, the only transfercoding is chunked. A message with no transfercoding is always acceptable. Trailer The Trailer general field value indicates that the given set of header fields is present in the trailer of a message encoded with chunked transfercoding. Trailer Trailer : 1fieldname An HTTP/ message SHOULD include a Trailer header field in a message using chunked transfercoding with a nonempty trailer. Doing so allows the recipient to know which header fields to expect in the trailer. If no Trailer header field is present, the trailer SHOULD NOT include any header fields. See section for restrictions on the use of trailer fields in a chunked transfercoding. Message header fields listed in the Trailer header field MUST NOT include the following header fields: . TransferEncoding . ContentLength . Trailer 附錄 B 超文本傳輸協(xié)議―― HTTP/ Referer Referer[sic] requestheader 域允許客戶端指定,為服務(wù)器的利益,資源的地址 ( URI),從中獲取 RequestURI(“ referrer”,盡管頭部域拼寫錯誤。