瑕佸皢Django瀹夎鍒癐IS涓婏紝鎮ㄥ彲浠ユ寜鐓т互涓嬫楠よ繘琛屾搷浣滐細


瀹夎IIS鏈嶅姟鍣細鎮ㄩ渶瑕佸湪Windows鏈嶅姟鍣ㄤ笂瀹夎IIS銆傛偍鍙互鍦ㄦ帶鍒堕潰鏉跨殑"绋嬪簭鍜屽姛鑳"涓夋嫨"鍚敤鎴栧叧闂璚indows鍔熻兘"锛岀劧鍚庨夋嫨IIS骞跺畨瑁呫


瀹夎Python锛氱‘淇濇偍鐨勬湇鍔″櫒涓婂凡缁忓畨瑁呬簡Python銆傛偍鍙互浠嶱ython瀹樻柟缃戠珯涓嬭浇骞跺畨瑁呮渶鏂扮殑Python鐗堟湰銆


瀹夎pip锛歱ip鏄疨ython鐨勫寘绠$悊鍣紝鍙互鏂逛究鍦板畨瑁匘jango鍜屽叾浠朠ython渚濊禆椤广傛偍鍙互鍦ㄥ懡浠ゆ彁绀虹涓嬭繍琛屼互涓嬪懡浠ゅ畨瑁卲ip锛


python -m ensurepip --upgrade


          

瀹夎Django锛氬湪鍛戒护鎻愮ず绗︿笅杩愯浠ヤ笅鍛戒护瀹夎Django锛

pip install django

   

          

鍒涘缓Django椤圭洰锛氬湪鍛戒护鎻愮ず绗︿笅锛屽鑸埌鎮ㄨ鍒涘缓Django椤圭洰鐨勭洰褰曪紝骞惰繍琛屼互涓嬪懡浠わ細

django-admin startproject myproject



          
杩欏皢鍒涘缓涓涓悕涓"myproject"鐨凞jango椤圭洰銆


閰嶇疆IIS锛氭墦寮IIS绠$悊鍣紝鍙抽敭鍗曞嚮"绔欑偣"锛岀劧鍚庨夋嫨"娣诲姞缃戠珯"銆傚湪"绔欑偣淇℃伅"涓紝鎸囧畾涓涓悕绉板苟閫夋嫨椤圭洰鐩綍銆傚湪"缁戝畾"涓紝閫夋嫨缃戠珯鐨勪富鏈哄悕鍜岀鍙e彿銆傚湪"鐗╃悊璺緞"涓紝鎸囧畾椤圭洰鐨勬牴鐩綍锛堝氨鏄笂涓姝ュ垱寤虹殑Django椤圭洰鐨勭洰褰曪級銆傜偣鍑"纭畾"鍒涘缓缃戠珯銆


閰嶇疆IIS FastCGI锛氬湪IIS绠$悊鍣ㄤ腑鐨"澶勭悊绋嬪簭鏄犲皠"涓紝鎵惧埌鍚嶄负"FastCGI"鐨勫鐞嗙▼搴忔槧灏勶紝骞剁‘淇濆畠宸插惎鐢ㄣ傚鏋滄病鏈夛紝璇峰彸閿崟鍑诲畠骞堕夋嫨"鍚敤"銆


閰嶇疆FastCGI搴旂敤绋嬪簭锛氬湪IIS绠$悊鍣ㄤ腑鐨"FastCGI 搴旂敤绋嬪簭"涓紝鎵惧埌鍚嶄负"python.exe"鐨勫簲鐢ㄧ▼搴忥紝骞剁‘淇濆畠宸插惎鐢ㄣ傚鏋滄病鏈夛紝璇峰彸閿崟鍑诲畠骞堕夋嫨"鍚敤"銆


淇敼web.config鏂囦欢锛氬湪椤圭洰鐨勬牴鐩綍涓嬶紝鎵惧埌鍚嶄负"web.config"鐨勬枃浠讹紝骞朵娇鐢ㄦ枃鏈紪杈戝櫒鎵撳紑瀹冦傚湪<handlers>鍏冪礌涓嬶紝娣诲姞浠ヤ笅浠g爜锛


<handler scriptProcessor="C:\Python[Python鐗堟湰]\python.exe|C:\Python[Python鐗堟湰]\Lib\site-packages\wfastcgi.py"
          name="Python FastCGI" path="*"
          verb="*" modules="FastCgiModule"
          requireAccess="Script" />



          
纭繚灏哰Python鐗堟湰]鏇挎崲涓烘偍鐨凱ython瀹夎璺緞鍜岀増鏈

閲嶅惎IIS鏈嶅姟鍣細鍦↖IS绠$悊鍣ㄤ腑锛屽彸閿崟鍑绘偍鍒涘缓鐨勭綉绔欙紝鐒跺悗閫夋嫨"閲嶆柊鍚姩"銆

鐜板湪锛屾偍鐨凞jango搴旂敤绋嬪簭宸茬粡瀹夎骞堕厤缃埌IIS涓婁簡銆傛偍鍙互閫氳繃璁块棶缃戠珯鐨勪富鏈哄悕鍜岀鍙e彿鏉ヨ闂畠銆傛潵婧愶細OD浜戝叏缃戣惀閿odweb.cn


浠ヤ笂灏辨槸python鐨刣jango濡備綍瀹夎鍒癐IS涓婅繍琛岀殑璇︾粏鍐呭锛屾洿澶氫俊鎭鍏虫敞OD浜戝叾瀹冪浉鍏虫枃绔狅紒



鏈枃URL锛http://www.odweb.cn/news_show.html?id=371