中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當前位置: 首頁 > news >正文

免費下載建設銀行官方網(wǎng)站濟南優(yōu)化網(wǎng)站的哪家好

免費下載建設銀行官方網(wǎng)站,濟南優(yōu)化網(wǎng)站的哪家好,哪個網(wǎng)站可以做翻譯賺錢,關于網(wǎng)站內容建設的正確說法HTTP協(xié)議 HTTP協(xié)議的常用方法 方法 描述 GET 請求指定的頁面信息,并返回實體主體。 POST 向指定資源提交數(shù)據(jù)進行處理請求(例如提交表單或者上傳文件)。數(shù)據(jù)被包含在請求體中。POST請求可能會導致新的資源的建立和/或已有資源的修改。 …

HTTP協(xié)議

HTTP協(xié)議的常用方法

方法

描述

GET

請求指定的頁面信息,并返回實體主體。

POST

向指定資源提交數(shù)據(jù)進行處理請求(例如提交表單或者上傳文件)。數(shù)據(jù)被包含在請求體中。POST請求可能會導致新的資源的建立和/或已有資源的修改。

HEAD

類似于GET請求,只不過返回的響應中沒有具體的內容,用于獲取報頭

PUT

從客戶端向服務器傳送的數(shù)據(jù)取代指定的文檔的內容。

DELETE

請求服務器刪除指定的頁面。

OPTIONS

允許客戶端查看服務器的性能。

HTTP狀態(tài)碼含義

代碼

含義

1**

?信息,請求收到,繼續(xù)處理

2**

成功,行為被成功地接受、理解和采納

3**

重定向,為了完成請求,必須進一步執(zhí)行的動作

4**

客戶端錯誤,請求包含語法錯誤或者請求無法實現(xiàn)

5**

服務器錯誤,服務器不能實現(xiàn)一種明顯無效的請求

前端基礎?

主要前端語言:Html、Css、JavaScript

html

Html:超文本標記語言,所以它不是一種編程語言而是一種標記語言,瀏覽器可以讀取html文檔并以網(wǎng)頁的形式進行展示

標記語言:是一套標記標簽,html標簽是由尖括號包圍的關鍵詞通常由兩個組成,第一個為開始標簽第二個為結束標簽

? ? ? ? 例如:<html>? ? ?</html>

? ? ? ? ? ? ? ? ? ?<p>? ? ?</p>

? ? ? ? ? ? ? ? ? ?<div>? ? ?</div> #作為一個盒子標簽,將里面的內容作為盒子內的內容

實例:

?結果顯示:網(wǎng)頁中打開

CSS簡介

CSS:是Cascading Style Sheets (層疊樣式表)的縮寫。CSS是一種標記語言, 用于為HTML文檔定義布局。例如css涉及字體、顏色、邊距、高度、寬度、背景色等等

可以有三種方式添加css樣式?

1. 直接在標簽后面添加

示例:

2.可以把所有的css樣式寫在head標簽里并設置一個類,然后調用類

示例

3. 創(chuàng)建一個css文件,然后載入css文件后調用文件中設置的類名

示例:

????????css文件:

? ? ? ? 引入css文件并調用:

三種使用css方式的優(yōu)先級

三種方式可以同時混用

優(yōu)先級:從內而外由高到底,所以以上三種第一種最高第三種最低

bootstrap

bootstrap:是其中一個非常優(yōu)秀的前端框架

中文網(wǎng)地址:Bootstrap中文網(wǎng)

示例:

javaScript

注意:javaScript與java毫無關系

JavaScript:是一種可以嵌入在HTML代碼中由客戶端瀏覽器運行的腳本語言。在網(wǎng)頁中使用JavaScript代碼,不僅可以實現(xiàn)網(wǎng)頁特效,還可以響應用戶請求實現(xiàn)動態(tài)交互的功能。

示例:點擊按鈕彈出事件

?

靜態(tài)服務器

實例:實現(xiàn)一個靜態(tài)服務器并根據(jù)客戶端訪問路徑訪問不同網(wǎng)頁

實現(xiàn)流程

本地創(chuàng)建一個Views目錄,目錄下存放兩個網(wǎng)頁

contact.html??

<!DOCTYPE html>
<html lang="UTF-8">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>明日科技</title>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
<!-- Documentation extras -->
<style>
body {position: relative; /* For scrollspy */
}/* Keep code small in tables on account of limited space */
.table code {font-size: 13px;font-weight: normal;
}/* Inline code within headings retain the heading's background-color */
h2 code,
h3 code,
h4 code {background-color: inherit;
}/* Outline button for use within the docs */
.btn-outline {color: #563d7c;background-color: transparent;border-color: #563d7c;
}
.btn-outline:hover,
.btn-outline:focus,
.btn-outline:active {color: #fff;background-color: #563d7c;border-color: #563d7c;
}/* Inverted outline button (white on dark) */
.btn-outline-inverse {color: #fff;background-color: transparent;border-color: #cdbfe3;
}
.btn-outline-inverse:hover,
.btn-outline-inverse:focus,
.btn-outline-inverse:active {color: #563d7c;text-shadow: none;background-color: #fff;border-color: #fff;
}/* Bootstrap "B" icon */
.bs-docs-booticon {display: block;font-weight: 500;color: #fff;text-align: center;cursor: default;background-color: #563d7c;border-radius: 15%;
}
.bs-docs-booticon-sm {width: 30px;height: 30px;font-size: 20px;line-height: 28px;
}
.bs-docs-booticon-lg {width: 144px;height: 144px;font-size: 90px;line-height: 140px;
}
.bs-docs-booticon-inverse {color: #563d7c;background-color: #fff;
}
.bs-docs-booticon-outline {background-color: transparent;border: 1px solid #cdbfe3;
}/** Main navigation** Turn the `.navbar` at the top of the docs purple.*/.bs-docs-nav {margin-bottom: 0;background-color: #fff;border-bottom: 0;
}
.bs-home-nav .bs-nav-b {display: none;
}
.bs-docs-nav .navbar-brand,
.bs-docs-nav .navbar-nav > li > a {font-weight: 500;color: #563d7c;
}
.bs-docs-nav .navbar-nav > li > a:hover,
.bs-docs-nav .navbar-nav > .active > a,
.bs-docs-nav .navbar-nav > .active > a:hover {color: #463265;background-color: #f9f9f9;
}
.bs-docs-nav .navbar-toggle .icon-bar {background-color: #563d7c;
}
.bs-docs-nav .navbar-header .navbar-toggle {border-color: #fff;
}
.bs-docs-nav .navbar-header .navbar-toggle:hover,
.bs-docs-nav .navbar-header .navbar-toggle:focus {background-color: #f9f9f9;border-color: #f9f9f9;
}/** Homepage** Tweaks to the custom homepage and the masthead (main jumbotron).*//* Share masthead with page headers */
.bs-docs-masthead,
.bs-docs-header {position: relative;padding: 30px 0;color: #cdbfe3;text-align: center;text-shadow: 0 1px 0 rgba(0,0,0,.1);background-color: #6f5499;background-image: -webkit-gradient(linear, left top, left bottom, from(#563d7c), to(#6f5499));background-image: -webkit-linear-gradient(top, #563d7c 0%, #6f5499 100%);background-image:      -o-linear-gradient(top, #563d7c 0%, #6f5499 100%);background-image:         linear-gradient(to bottom, #563d7c 0%, #6f5499 100%);filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#563d7c', endColorstr='#6F5499', GradientType=0);background-repeat: repeat-x;
}/* Masthead (headings and download button) */
.bs-docs-masthead .bs-docs-booticon {margin: 0 auto 30px;
}
.bs-docs-masthead h1 {font-weight: 300;line-height: 1;color: #fff;
}
.bs-docs-masthead .lead {margin: 0 auto 30px;font-size: 20px;color: #fff;
}
.bs-docs-masthead .version {margin-top: -15px;margin-bottom: 30px;color: #9783b9;
}
.bs-docs-masthead .btn {width: 100%;padding: 15px 30px;font-size: 20px;
}@media (min-width: 480px) {.bs-docs-masthead .btn {width: auto;}
}@media (min-width: 768px) {.bs-docs-masthead {padding: 80px 0;}.bs-docs-masthead h1 {font-size: 60px;}.bs-docs-masthead .lead {font-size: 24px;}
}
</style><!-- Analytics
================================================== -->
</head><body class="bs-docs-home"><a id="skippy" class="sr-only sr-only-focusable" href="https://v3.bootcss.com/#content"><div class="container"><span class="skiplink-text">Skip to main content</span></div></a><!-- Docs master nav --><header class="navbar navbar-static-top bs-docs-nav" id="top"><div class="container"><div class="navbar-header"><a href="/" class="navbar-brand">明日學院</a></div><nav id="bs-navbar" class="collapse navbar-collapse"><ul class="nav navbar-nav"><li><a href="/course.html" >課程</a></li><li><a href="http://www.mingrisoft.com/book.html">讀書</a></li><li><a href="http://www.mingrisoft.com/bbs.html">社區(qū)</a></li><li><a href="http://www.mingrisoft.com/servicecenter.html">服務</a></li><li><a href="/contact.html">聯(lián)系我們</a></li></ul></nav></div>
</header><!-- Page content of course! -->
<div class="bs-docs-header" id="content" tabindex="-1"><div class="container"><h1> 聯(lián)系我們 </h1><div class="lead"><address>電子郵件:<strong>mingrisoft@mingrisoft.com</strong><br>地址:吉林省長春市寬城區(qū)北湖科技園<br>郵政編碼:<strong>130000</strong><br><abbr title="Phone">聯(lián)系電話:</abbr> 0431-84978981</address></div></div></div>
</body>
</html>

index.html

<!DOCTYPE html>
<html lang="UTF-8">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>明日科技
</title>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" 
<!-- Documentation extras -->
<style>
body {position: relative; /* For scrollspy */
}/* Keep code small in tables on account of limited space */
.table code {font-size: 13px;font-weight: normal;
}/* Inline code within headings retain the heading's background-color */
h2 code,
h3 code,
h4 code {background-color: inherit;
}/* Outline button for use within the docs */
.btn-outline {color: #563d7c;background-color: transparent;border-color: #563d7c;
}
.btn-outline:hover,
.btn-outline:focus,
.btn-outline:active {color: #fff;background-color: #563d7c;border-color: #563d7c;
}/* Inverted outline button (white on dark) */
.btn-outline-inverse {color: #fff;background-color: transparent;border-color: #cdbfe3;
}
.btn-outline-inverse:hover,
.btn-outline-inverse:focus,
.btn-outline-inverse:active {color: #563d7c;text-shadow: none;background-color: #fff;border-color: #fff;
}/* Bootstrap "B" icon */
.bs-docs-booticon {display: block;font-weight: 500;color: #fff;text-align: center;cursor: default;background-color: #563d7c;border-radius: 15%;
}
.bs-docs-booticon-sm {width: 30px;height: 30px;font-size: 20px;line-height: 28px;
}
.bs-docs-booticon-lg {width: 144px;height: 144px;font-size: 90px;line-height: 140px;
}
.bs-docs-booticon-inverse {color: #563d7c;background-color: #fff;
}
.bs-docs-booticon-outline {background-color: transparent;border: 1px solid #cdbfe3;
}/** Main navigation** Turn the `.navbar` at the top of the docs purple.*/.bs-docs-nav {margin-bottom: 0;background-color: #fff;border-bottom: 0;
}
.bs-home-nav .bs-nav-b {display: none;
}
.bs-docs-nav .navbar-brand,
.bs-docs-nav .navbar-nav > li > a {font-weight: 500;color: #563d7c;
}
.bs-docs-nav .navbar-nav > li > a:hover,
.bs-docs-nav .navbar-nav > .active > a,
.bs-docs-nav .navbar-nav > .active > a:hover {color: #463265;background-color: #f9f9f9;
}
.bs-docs-nav .navbar-toggle .icon-bar {background-color: #563d7c;
}
.bs-docs-nav .navbar-header .navbar-toggle {border-color: #fff;
}
.bs-docs-nav .navbar-header .navbar-toggle:hover,
.bs-docs-nav .navbar-header .navbar-toggle:focus {background-color: #f9f9f9;border-color: #f9f9f9;
}/** Homepage** Tweaks to the custom homepage and the masthead (main jumbotron).*//* Share masthead with page headers */
.bs-docs-masthead,
.bs-docs-header {position: relative;padding: 30px 0;color: #cdbfe3;text-align: center;text-shadow: 0 1px 0 rgba(0,0,0,.1);background-color: #6f5499;background-image: -webkit-gradient(linear, left top, left bottom, from(#563d7c), to(#6f5499));background-image: -webkit-linear-gradient(top, #563d7c 0%, #6f5499 100%);background-image:      -o-linear-gradient(top, #563d7c 0%, #6f5499 100%);background-image:         linear-gradient(to bottom, #563d7c 0%, #6f5499 100%);filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#563d7c', endColorstr='#6F5499', GradientType=0);background-repeat: repeat-x;
}/* Masthead (headings and download button) */
.bs-docs-masthead .bs-docs-booticon {margin: 0 auto 30px;
}
.bs-docs-masthead h1 {font-weight: 300;line-height: 1;color: #fff;
}
.bs-docs-masthead .lead {margin: 0 auto 30px;font-size: 20px;color: #fff;
}
.bs-docs-masthead .version {margin-top: -15px;margin-bottom: 30px;color: #9783b9;
}
.bs-docs-masthead .btn {width: 100%;padding: 15px 30px;font-size: 20px;
}@media (min-width: 480px) {.bs-docs-masthead .btn {width: auto;}
}@media (min-width: 768px) {.bs-docs-masthead {padding: 80px 0;}.bs-docs-masthead h1 {font-size: 60px;}.bs-docs-masthead .lead {font-size: 24px;}
}
</style><!-- Analytics
================================================== -->
</head><body class="bs-docs-home"><!-- Docs master nav --><header class="navbar navbar-static-top bs-docs-nav" id="top"><div class="container"><div class="navbar-header"><a href="/" class="navbar-brand">明日學院</a></div><nav id="bs-navbar" class="collapse navbar-collapse"><ul class="nav navbar-nav"><li><a href="http://www.mingrisoft.com/selfCourse.html" >課程</a></li><li><a href="http://www.mingrisoft.com/book.html">讀書</a></li><li><a href="http://www.mingrisoft.com/bbs.html">社區(qū)</a></li><li><a href="http://www.mingrisoft.com/servicecenter.html">服務</a></li><li><a href="/contact.html">聯(lián)系我們</a></li></ul></nav></div>
</header><!-- Page content of course! --><main class="bs-docs-masthead" id="content" tabindex="-1"><div class="container"><span class="bs-docs-booticon bs-docs-booticon-lg bs-docs-booticon-outline">MR</span><p class="lead">明日學院,是吉林省明日科技有限公司傾力打造的在線實用技能學習平臺,該平臺于2016年正式上線,主要為學習者提供海量、優(yōu)質的課程,課程結構嚴謹,用戶可以根據(jù)自身的學習程度,自主安排學習進度。我們的宗旨是,為編程學習者提供一站式服務,培養(yǎng)用戶的編程思維。</p><p class="lead"><a href="/contact.html" class="btn btn-outline-inverse btn-lg">聯(lián)系我們</a></p></div>
</main>
</body>
</html>

服務器python代碼

# coding:utf-8import socket  # 導入Socket模塊
import re       # 導入re正則模塊
from multiprocessing import Process  # 導入Process多線程模塊HTML_ROOT_DIR = "./Views"   # 設置靜態(tài)文件根目錄class HTTPServer(object):def __init__(self):"""初始化方法"""self.server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # 創(chuàng)建Socket對象def start(self):"""開始方法"""self.server_socket.listen(128) #設置最多連接數(shù)print ('服務器等待客戶端連接...')# 執(zhí)行死循環(huán)while True:client_socket, client_address = self.server_socket.accept() #建立客戶端連接print("[%s, %s]用戶連接上了" % client_address)handle_client_process = Process(target=self.handle_client, args=(client_socket,)) #實例化線程類handle_client_process.start() # 開啟線程client_socket.close()           # 關閉客戶端Socketdef handle_client(self, client_socket):"""處理客戶端請求"""# 獲取客戶端請求數(shù)據(jù)request_data = client_socket.recv(1024) #獲取客戶端請求數(shù)據(jù)print("request data:", request_data)request_lines = request_data.splitlines() # 按照行('\r', '\r\n', \n')分隔# 輸出每行新型for line in request_lines:print(line)request_start_line = request_lines[0]  # 解析請求報文print("*" * 10)print(request_start_line.decode("utf-8"))# 使用正則表達式,提取用戶請求的文件名file_name = re.match(r"\w+ +(/[^ ]*) ", request_start_line.decode("utf-8")).group(1)# 如果文件名是根目錄,設置文件名為file_nameif "/" == file_name:file_name = "/index.html"# 打開文件,讀取內容try:file = open(HTML_ROOT_DIR + file_name, "rb")except IOError:# 如果異常,返回404response_start_line = "HTTP/1.1 404 Not Found\r\n"response_headers = "Server: My server\r\n"response_body = "The file is not found!"else:# 讀取文件內容file_data = file.read()file.close()# 構造響應數(shù)據(jù)response_start_line = "HTTP/1.1 200 OK\r\n"response_headers = "Server: My server\r\n"response_body = file_data.decode("utf-8")response = response_start_line + response_headers + "\r\n" + response_body # 拼接返回數(shù)據(jù)print("response data:", response)client_socket.send(bytes(response, "utf-8")) # 向客戶端返回響應數(shù)據(jù)client_socket.close()   # 關閉客戶端連接def bind(self, port):"""綁定端口"""self.server_socket.bind(("", port))def main():"""主函數(shù)"""http_server = HTTPServer()  # 實例化HTTPServer()類http_server.bind(8000)      # 綁定端口http_server.start()         # 調用start()方法if __name__ == "__main__":main()                    # 執(zhí)行main()函數(shù)

驗證:運行python然后瀏覽器訪問127.0.0.1:8000

CGI、FastCGI

CGI

CGI (Common Gateway Interface):即通用網(wǎng)關接口,它是一段程序,運行在服務器上。

CGI工作原理:

????????客戶端登陸一個系統(tǒng)通過post方式將數(shù)據(jù)提交給web服務器,web服務器自身不做處理,它會調用CGI應用程序進行處理并返回結果,web服務器最后把結果返回給客戶端最終生成動態(tài)的html頁面

CGI?局限性:?

????????當一個用戶登陸網(wǎng)站時就需要創(chuàng)建一個CGI請求,用完以后就拋棄,如果用戶很多就會創(chuàng)建很多進程導致服務器崩潰

解決辦法:FastCGI

FastCGI

FastCGI:

????????CGI的加強版。他是用進程線程池處理一連串的請求,這些進程線程由FastCGI服務器自己管理而不是由web服務器自己管理,所以FastCGI能是服務器同時處理更多的請求

缺陷:編寫程序時不方便

解決辦法:WSGI? ? ?

WSGI

WSGI (服務器網(wǎng)關接口):

????????是為Python語言定義的web服務器和web應用程序或者是框架之間的一種簡單而通用的接口,它是基于FastCGI設計的。

WSGI工作原理

客戶端向web服務器發(fā)起一個請求,WSGI的底層是通過FastCGI進行溝通,當server服務器接受到請求以后可以通過socket套接字把環(huán)境變量和一個callback函數(shù)傳遞給后端的Application,之后在應用程序中完成頁面組裝,然后通過回調函數(shù)返回給服務器,最后服務器再將響應????????

補充:

? ? ? ? callback函數(shù):回調函數(shù)是一個函數(shù),將會在另一個函數(shù)完成執(zhí)行后立即執(zhí)行。回調函數(shù)是一個作為參數(shù)傳給另一個函數(shù)的函數(shù),這個回調函數(shù)會在傳給的函數(shù)內部執(zhí)行。

定義WSGI接口

語法:

?(此函數(shù)的兩個參數(shù)都需要從服務器獲取,所以這本函數(shù)必須由WSGI服務器來調用。)

def application(environ,start_response):
? ? start_response(status,response_headers)
? ? return [response_body]

? ? ? ? #application:自定義函數(shù)名

? ? ? ? #environ:這是一個包含所有HTTP請求信息的dict對象

? ? ? ? #?start_response:一個發(fā)送http響應的函數(shù)

示例:

def application(environ,start_response):start_response('200 OK',[('Content-Type,'text/html')])return [b'<h1>Hello,World!</h1>']

實例:通過wsgiref模塊實現(xiàn)一個簡單的hello,word

目前apache、nginx等web服務器都符合WSGI接口的規(guī)范,在python中也內置了一個WSGI服務器:wsgiref模塊

from wsgiref.simple_server  import make_server#回調函數(shù)
def sayHi(environ,start_response):#以元組的方式添加響應頭start_response("200 OK", [('Content-Type', 'text/html; charset=utf-8')])#body部分return [b'Hello World']
if __name__=='__main__':#三個參數(shù):IP地址默認為127.0.0.1,端口號,回調函數(shù)ser = make_server('',8000,sayHi)#啟動程序ser.serve_forever()

驗證:終端運行此程序,然后瀏覽器訪問127.0.0.1

運行WSGI服務

實例:創(chuàng)建網(wǎng)站課程頁面,根據(jù)訪問地址訪問不同html頁面

三個網(wǎng)頁:

contact.html

<!DOCTYPE html>
<html lang="UTF-8">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>明日科技
</title>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
<!-- Documentation extras -->
<style>
body {position: relative; /* For scrollspy */
}/* Keep code small in tables on account of limited space */
.table code {font-size: 13px;font-weight: normal;
}/* Inline code within headings retain the heading's background-color */
h2 code,
h3 code,
h4 code {background-color: inherit;
}/* Outline button for use within the docs */
.btn-outline {color: #563d7c;background-color: transparent;border-color: #563d7c;
}
.btn-outline:hover,
.btn-outline:focus,
.btn-outline:active {color: #fff;background-color: #563d7c;border-color: #563d7c;
}/* Inverted outline button (white on dark) */
.btn-outline-inverse {color: #fff;background-color: transparent;border-color: #cdbfe3;
}
.btn-outline-inverse:hover,
.btn-outline-inverse:focus,
.btn-outline-inverse:active {color: #563d7c;text-shadow: none;background-color: #fff;border-color: #fff;
}/* Bootstrap "B" icon */
.bs-docs-booticon {display: block;font-weight: 500;color: #fff;text-align: center;cursor: default;background-color: #563d7c;border-radius: 15%;
}
.bs-docs-booticon-sm {width: 30px;height: 30px;font-size: 20px;line-height: 28px;
}
.bs-docs-booticon-lg {width: 144px;height: 144px;font-size: 90px;line-height: 140px;
}
.bs-docs-booticon-inverse {color: #563d7c;background-color: #fff;
}
.bs-docs-booticon-outline {background-color: transparent;border: 1px solid #cdbfe3;
}/** Main navigation** Turn the `.navbar` at the top of the docs purple.*/.bs-docs-nav {margin-bottom: 0;background-color: #fff;border-bottom: 0;
}
.bs-home-nav .bs-nav-b {display: none;
}
.bs-docs-nav .navbar-brand,
.bs-docs-nav .navbar-nav > li > a {font-weight: 500;color: #563d7c;
}
.bs-docs-nav .navbar-nav > li > a:hover,
.bs-docs-nav .navbar-nav > .active > a,
.bs-docs-nav .navbar-nav > .active > a:hover {color: #463265;background-color: #f9f9f9;
}
.bs-docs-nav .navbar-toggle .icon-bar {background-color: #563d7c;
}
.bs-docs-nav .navbar-header .navbar-toggle {border-color: #fff;
}
.bs-docs-nav .navbar-header .navbar-toggle:hover,
.bs-docs-nav .navbar-header .navbar-toggle:focus {background-color: #f9f9f9;border-color: #f9f9f9;
}/** Homepage** Tweaks to the custom homepage and the masthead (main jumbotron).*//* Share masthead with page headers */
.bs-docs-masthead,
.bs-docs-header {position: relative;padding: 30px 0;color: #cdbfe3;text-align: center;text-shadow: 0 1px 0 rgba(0,0,0,.1);background-color: #6f5499;background-image: -webkit-gradient(linear, left top, left bottom, from(#563d7c), to(#6f5499));background-image: -webkit-linear-gradient(top, #563d7c 0%, #6f5499 100%);background-image:      -o-linear-gradient(top, #563d7c 0%, #6f5499 100%);background-image:         linear-gradient(to bottom, #563d7c 0%, #6f5499 100%);filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#563d7c', endColorstr='#6F5499', GradientType=0);background-repeat: repeat-x;
}/* Masthead (headings and download button) */
.bs-docs-masthead .bs-docs-booticon {margin: 0 auto 30px;
}
.bs-docs-masthead h1 {font-weight: 300;line-height: 1;color: #fff;
}
.bs-docs-masthead .lead {margin: 0 auto 30px;font-size: 20px;color: #fff;
}
.bs-docs-masthead .version {margin-top: -15px;margin-bottom: 30px;color: #9783b9;
}
.bs-docs-masthead .btn {width: 100%;padding: 15px 30px;font-size: 20px;
}@media (min-width: 480px) {.bs-docs-masthead .btn {width: auto;}
}@media (min-width: 768px) {.bs-docs-masthead {padding: 80px 0;}.bs-docs-masthead h1 {font-size: 60px;}.bs-docs-masthead .lead {font-size: 24px;}
}
</style><!-- Analytics
================================================== -->
</head><body class="bs-docs-home"><a id="skippy" class="sr-only sr-only-focusable" href="https://v3.bootcss.com/#content"><div class="container"><span class="skiplink-text">Skip to main content</span></div></a><!-- Docs master nav --><header class="navbar navbar-static-top bs-docs-nav" id="top"><div class="container"><div class="navbar-header"><a href="/" class="navbar-brand">明日學院</a></div><nav id="bs-navbar" class="collapse navbar-collapse"><ul class="nav navbar-nav"><li><a href="/course.html" >課程</a></li><li><a href="http://www.mingrisoft.com/book.html">讀書</a></li><li><a href="http://www.mingrisoft.com/bbs.html">社區(qū)</a></li><li><a href="http://www.mingrisoft.com/servicecenter.html">服務</a></li><li><a href="/contact.html">聯(lián)系我們</a></li></ul></nav></div>
</header><!-- Page content of course! -->
<div class="bs-docs-header" id="content" tabindex="-1"><div class="container"><h1> 聯(lián)系我們 </h1><div class="lead"><address>電子郵件:<strong>mingrisoft@mingrisoft.com</strong><br>地址:吉林省長春市南關區(qū)財富領域<br>郵政編碼:<strong>131200</strong><br><abbr title="Phone">聯(lián)系電話:</abbr> 0431-84978981</address></div></div></div>
</body>
</html>

course.html

<!DOCTYPE html>
<html lang="UTF-8">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>明日科技
</title>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" 
<!-- Documentation extras -->
<style>
body {position: relative; /* For scrollspy */
}/* Keep code small in tables on account of limited space */
.table code {font-size: 13px;font-weight: normal;
}/* Inline code within headings retain the heading's background-color */
h2 code,
h3 code,
h4 code {background-color: inherit;
}/* Outline button for use within the docs */
.btn-outline {color: #563d7c;background-color: transparent;border-color: #563d7c;
}
.btn-outline:hover,
.btn-outline:focus,
.btn-outline:active {color: #fff;background-color: #563d7c;border-color: #563d7c;
}/* Inverted outline button (white on dark) */
.btn-outline-inverse {color: #fff;background-color: transparent;border-color: #cdbfe3;
}
.btn-outline-inverse:hover,
.btn-outline-inverse:focus,
.btn-outline-inverse:active {color: #563d7c;text-shadow: none;background-color: #fff;border-color: #fff;
}/* Bootstrap "B" icon */
.bs-docs-booticon {display: block;font-weight: 500;color: #fff;text-align: center;cursor: default;background-color: #563d7c;border-radius: 15%;
}
.bs-docs-booticon-sm {width: 30px;height: 30px;font-size: 20px;line-height: 28px;
}
.bs-docs-booticon-lg {width: 144px;height: 144px;font-size: 90px;line-height: 140px;
}
.bs-docs-booticon-inverse {color: #563d7c;background-color: #fff;
}
.bs-docs-booticon-outline {background-color: transparent;border: 1px solid #cdbfe3;
}/** Main navigation** Turn the `.navbar` at the top of the docs purple.*/.bs-docs-nav {margin-bottom: 0;background-color: #fff;border-bottom: 0;
}
.bs-home-nav .bs-nav-b {display: none;
}
.bs-docs-nav .navbar-brand,
.bs-docs-nav .navbar-nav > li > a {font-weight: 500;color: #563d7c;
}
.bs-docs-nav .navbar-nav > li > a:hover,
.bs-docs-nav .navbar-nav > .active > a,
.bs-docs-nav .navbar-nav > .active > a:hover {color: #463265;background-color: #f9f9f9;
}
.bs-docs-nav .navbar-toggle .icon-bar {background-color: #563d7c;
}
.bs-docs-nav .navbar-header .navbar-toggle {border-color: #fff;
}
.bs-docs-nav .navbar-header .navbar-toggle:hover,
.bs-docs-nav .navbar-header .navbar-toggle:focus {background-color: #f9f9f9;border-color: #f9f9f9;
}/** Homepage** Tweaks to the custom homepage and the masthead (main jumbotron).*//* Share masthead with page headers */
.bs-docs-masthead,
.bs-docs-header {position: relative;padding: 30px 0;color: #cdbfe3;text-align: center;text-shadow: 0 1px 0 rgba(0,0,0,.1);background-color: #6f5499;background-image: -webkit-gradient(linear, left top, left bottom, from(#563d7c), to(#6f5499));background-image: -webkit-linear-gradient(top, #563d7c 0%, #6f5499 100%);background-image:      -o-linear-gradient(top, #563d7c 0%, #6f5499 100%);background-image:         linear-gradient(to bottom, #563d7c 0%, #6f5499 100%);filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#563d7c', endColorstr='#6F5499', GradientType=0);background-repeat: repeat-x;
}/* Masthead (headings and download button) */
.bs-docs-masthead .bs-docs-booticon {margin: 0 auto 30px;
}
.bs-docs-masthead h1 {font-weight: 300;line-height: 1;color: #fff;
}
.bs-docs-masthead .lead {margin: 0 auto 30px;font-size: 20px;color: #fff;
}
.bs-docs-masthead .version {margin-top: -15px;margin-bottom: 30px;color: #9783b9;
}
.bs-docs-masthead .btn {width: 100%;padding: 15px 30px;font-size: 20px;
}@media (min-width: 480px) {.bs-docs-masthead .btn {width: auto;}
}@media (min-width: 768px) {.bs-docs-masthead {padding: 80px 0;}.bs-docs-masthead h1 {font-size: 60px;}.bs-docs-masthead .lead {font-size: 24px;}
}
</style><!-- Analytics
================================================== -->
</head><body class="bs-docs-home"><!-- Docs master nav --><header class="navbar navbar-static-top bs-docs-nav" id="top"><div class="container"><div class="navbar-header"><a href="/" class="navbar-brand">明日學院</a></div><nav id="bs-navbar" class="collapse navbar-collapse"><ul class="nav navbar-nav"><li><a href="/course.html" >課程</a></li><li><a href="http://www.mingrisoft.com/book.html">讀書</a></li><li><a href="http://www.mingrisoft.com/bbs.html">社區(qū)</a></li><li><a href="http://www.mingrisoft.com/servicecenter.html">服務</a></li><li><a href="/contact.html">聯(lián)系我們</a></li></ul></nav></div>
</header><!-- Page content of course! --><main class="bs-docs-masthead" id="content" tabindex="-1"><div class="container"><div class="jumbotron"><h1 style="color: #573e7d">明日課程</h1><p style="color: #573e7d">海量課程,隨時隨地,想學就學。有多名專業(yè)講師精心打造精品課程,讓學習創(chuàng)造屬于你的生活</p><p><a class="btn btn-primary btn-lg" href="http://www.mingrisoft.com/selfCourse.html" role="button">開始學習</a></p></div></div>
</main>
</body>
</html>

index.html

<!DOCTYPE html>
<html lang="UTF-8">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>明日科技
</title>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" 
<!-- Documentation extras -->
<style>
body {position: relative; /* For scrollspy */
}/* Keep code small in tables on account of limited space */
.table code {font-size: 13px;font-weight: normal;
}/* Inline code within headings retain the heading's background-color */
h2 code,
h3 code,
h4 code {background-color: inherit;
}/* Outline button for use within the docs */
.btn-outline {color: #563d7c;background-color: transparent;border-color: #563d7c;
}
.btn-outline:hover,
.btn-outline:focus,
.btn-outline:active {color: #fff;background-color: #563d7c;border-color: #563d7c;
}/* Inverted outline button (white on dark) */
.btn-outline-inverse {color: #fff;background-color: transparent;border-color: #cdbfe3;
}
.btn-outline-inverse:hover,
.btn-outline-inverse:focus,
.btn-outline-inverse:active {color: #563d7c;text-shadow: none;background-color: #fff;border-color: #fff;
}/* Bootstrap "B" icon */
.bs-docs-booticon {display: block;font-weight: 500;color: #fff;text-align: center;cursor: default;background-color: #563d7c;border-radius: 15%;
}
.bs-docs-booticon-sm {width: 30px;height: 30px;font-size: 20px;line-height: 28px;
}
.bs-docs-booticon-lg {width: 144px;height: 144px;font-size: 90px;line-height: 140px;
}
.bs-docs-booticon-inverse {color: #563d7c;background-color: #fff;
}
.bs-docs-booticon-outline {background-color: transparent;border: 1px solid #cdbfe3;
}/** Main navigation** Turn the `.navbar` at the top of the docs purple.*/.bs-docs-nav {margin-bottom: 0;background-color: #fff;border-bottom: 0;
}
.bs-home-nav .bs-nav-b {display: none;
}
.bs-docs-nav .navbar-brand,
.bs-docs-nav .navbar-nav > li > a {font-weight: 500;color: #563d7c;
}
.bs-docs-nav .navbar-nav > li > a:hover,
.bs-docs-nav .navbar-nav > .active > a,
.bs-docs-nav .navbar-nav > .active > a:hover {color: #463265;background-color: #f9f9f9;
}
.bs-docs-nav .navbar-toggle .icon-bar {background-color: #563d7c;
}
.bs-docs-nav .navbar-header .navbar-toggle {border-color: #fff;
}
.bs-docs-nav .navbar-header .navbar-toggle:hover,
.bs-docs-nav .navbar-header .navbar-toggle:focus {background-color: #f9f9f9;border-color: #f9f9f9;
}/** Homepage** Tweaks to the custom homepage and the masthead (main jumbotron).*//* Share masthead with page headers */
.bs-docs-masthead,
.bs-docs-header {position: relative;padding: 30px 0;color: #cdbfe3;text-align: center;text-shadow: 0 1px 0 rgba(0,0,0,.1);background-color: #6f5499;background-image: -webkit-gradient(linear, left top, left bottom, from(#563d7c), to(#6f5499));background-image: -webkit-linear-gradient(top, #563d7c 0%, #6f5499 100%);background-image:      -o-linear-gradient(top, #563d7c 0%, #6f5499 100%);background-image:         linear-gradient(to bottom, #563d7c 0%, #6f5499 100%);filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#563d7c', endColorstr='#6F5499', GradientType=0);background-repeat: repeat-x;
}/* Masthead (headings and download button) */
.bs-docs-masthead .bs-docs-booticon {margin: 0 auto 30px;
}
.bs-docs-masthead h1 {font-weight: 300;line-height: 1;color: #fff;
}
.bs-docs-masthead .lead {margin: 0 auto 30px;font-size: 20px;color: #fff;
}
.bs-docs-masthead .version {margin-top: -15px;margin-bottom: 30px;color: #9783b9;
}
.bs-docs-masthead .btn {width: 100%;padding: 15px 30px;font-size: 20px;
}@media (min-width: 480px) {.bs-docs-masthead .btn {width: auto;}
}@media (min-width: 768px) {.bs-docs-masthead {padding: 80px 0;}.bs-docs-masthead h1 {font-size: 60px;}.bs-docs-masthead .lead {font-size: 24px;}
}
</style><!-- Analytics
================================================== -->
</head><body class="bs-docs-home"><!-- Docs master nav --><header class="navbar navbar-static-top bs-docs-nav" id="top"><div class="container"><div class="navbar-header"><a href="/" class="navbar-brand">明日學院</a></div><nav id="bs-navbar" class="collapse navbar-collapse"><ul class="nav navbar-nav"><li><a href="/course.html" >課程</a></li><li><a href="http://www.mingrisoft.com/book.html">讀書</a></li><li><a href="http://www.mingrisoft.com/bbs.html">社區(qū)</a></li><li><a href="http://www.mingrisoft.com/servicecenter.html">服務</a></li><li><a href="/contact.html">聯(lián)系我們</a></li></ul></nav></div>
</header><!-- Page content of course! --><main class="bs-docs-masthead" id="content" tabindex="-1"><div class="container"><span class="bs-docs-booticon bs-docs-booticon-lg bs-docs-booticon-outline">MR</span><p class="lead">明日學院,是吉林省明日科技有限公司傾力打造的在線實用技能學習平臺,該平臺于2016年正式上線,主要為學習者提供海量、優(yōu)質的課程,課程結構嚴謹,用戶可以根據(jù)自身的學習程度,自主安排學習進度。我們的宗旨是,為編程學習者提供一站式服務,培養(yǎng)用戶的編程思維。</p><p class="lead"><a href="/contact.html" class="btn btn-outline-inverse btn-lg">聯(lián)系我們</a></p></div>
</main>
</body>
</html>

python代碼:

# 從wsgiref模塊導入:
from wsgiref.simple_server import make_server
# 導入我們自己編寫的application函數(shù):
def app(environ, start_response):start_response('200 OK', [('Content-Type', 'text/html')])     # 響應信息#environ['PATH_INFO']:通過環(huán)境變量加一個鍵值就能獲取到請求URL后綴的文件名file_name = environ['PATH_INFO'][1:] or 'index.html'        # 獲取url參數(shù)HTML_ROOT_DIR = './Views/'  # 設置HTML文件目錄try:file = open(HTML_ROOT_DIR + file_name, "rb")  # 以二進制方式打開文件except IOError:response = "The file is not found!"     # 如果異常,返回404else:file_data = file.read() # 讀取文件內容file.close()            # 關閉文件response = file_data.decode("utf-8") # 構造響應數(shù)據(jù)return [response.encode('utf-8')] # 返回數(shù)據(jù)# 創(chuàng)建一個服務器,IP地址為空,端口是8000,處理函數(shù)是application:
httpd = make_server('', 8000, app)
print('Serving HTTP on port 8000...')
# 開始監(jiān)聽HTTP請求:
httpd.serve_forever()

驗證:運行python代碼,然后瀏覽器訪問

web框架

web框架:是實現(xiàn)一些基礎功能的一堆代碼,可以理解為一個通用的半成品。通過使用web框架開發(fā)人員可以把更多的精力精力集中在實現(xiàn)具體業(yè)務上。web框架可以使用任何語言來編寫。這些框架通常能提供一些常用的功能。只要遵循WSGI規(guī)范也能編寫我們自己的web框架,因為WSGI接口就是服務器與框架之間簡單而通用的接口

web框架的常用功能:

? ? ? ? 管理路由

? ? ? ? 訪問數(shù)據(jù)庫

? ? ? ? 管理會話和Cookies

? ? ? ? 創(chuàng)建模板來顯示Html

? ? ? ? 促進代碼的重用

常用的python web框架

? ? ? ? Flask框架:輕量級的web框架,他是基于Werkzeug實現(xiàn)的WSGI和Jinja2模板引擎。它的設計哲學是只保留核心,其他的通過擴展機制來增強它的功能

? ? ? ? django框架:它提供了非常齊備的官方文檔和一站式解決方案,包括緩存、orm管理后臺、驗證、表單處理等等。由于具備了這些功能使開發(fā)復雜的數(shù)據(jù)庫驅動的網(wǎng)站變得更加簡單。但是會導致系統(tǒng)耦合度過高,如果我們要替換掉django內部的一些功能就會非常麻煩

? ? ? ? Bottle框架:輕量級的web框架。它只有一個文件,代碼只使用了python的標準庫卻自帶了路由映射、模板、簡單的數(shù)據(jù)訪問等web框架組件,而不需要依賴額外第三方庫,所以它才是真正的微框架。它的語法簡單部署也非常方便

? ? ? ? Tornado框架:是一個非阻塞的web服務器所以速度非???#xff0c;每秒中可以處理數(shù)以千計的鏈接,這就意味著對于常輪詢、web套接字等服務來說Tornado是一個理想的web框架

http://www.risenshineclean.com/news/916.html

相關文章:

  • 岳陽網(wǎng)站開發(fā)商城網(wǎng)絡推廣項目計劃書
  • 校園網(wǎng)站建設模板上海網(wǎng)站排名seo公司哪家好
  • 做網(wǎng)站賭博代理違法嗎品牌推廣是做什么的
  • 做營銷網(wǎng)站制作seo綜合查詢是什么意思
  • 企業(yè)網(wǎng)站怎么做畢業(yè)設計網(wǎng)站怎么營銷推廣
  • b2b平臺有哪些類別網(wǎng)絡營銷優(yōu)化
  • 做免費網(wǎng)站教程國vs百度seo排名優(yōu)化軟件化
  • 萊蕪二手房網(wǎng)湖南seo優(yōu)化報價
  • wordpress顯示輪播圖深圳市seo上詞多少錢
  • 網(wǎng)絡投注網(wǎng)站是怎么建設簡述網(wǎng)絡營銷的概念
  • 可以免費開店的平臺windows11優(yōu)化大師
  • 網(wǎng)站動態(tài)小圖標青島網(wǎng)絡seo公司
  • 日本中古手表網(wǎng)站申請網(wǎng)站怎么申請
  • 襄陽做網(wǎng)站哪家好b2b平臺有哪些
  • 電子商務網(wǎng)站開發(fā)的基本流程軟文營銷的特點有哪些
  • 深圳 建設銀行國際互聯(lián)網(wǎng)站網(wǎng)絡推廣公司排名
  • 這幾年做網(wǎng)站怎么樣百度搜索風云榜排行榜
  • 東莞網(wǎng)站設計報價天津百度網(wǎng)站排名優(yōu)化
  • 有哪些網(wǎng)站可以做淘寶客搜索seo怎么優(yōu)化
  • 搭建服務器做網(wǎng)站公司如何在百度宣傳
  • 9uu域名更新自動轉跳seo怎么優(yōu)化步驟
  • 湖南省住房和城鄉(xiāng)建設網(wǎng)站網(wǎng)絡seo推廣培訓
  • 網(wǎng)頁版的游戲百度推廣優(yōu)化師
  • wordpress聯(lián)系表單插件seo整體優(yōu)化步驟怎么寫
  • 鄭州專業(yè)做淘寶網(wǎng)站推廣蘇州疫情最新消息
  • 做招聘網(wǎng)站的客戶想退錢網(wǎng)站seo快速排名優(yōu)化
  • 做京東網(wǎng)站需要哪些手續(xù)參考網(wǎng)是合法網(wǎng)站嗎?
  • 免費發(fā)布推廣信息軟件搜索引擎優(yōu)化工作
  • dedecms網(wǎng)站太原seo快速排名怎么樣
  • 公司做網(wǎng)站價格足球比賽今日最新推薦