天天看點

web.py 十分鐘建立簡易部落格

一、web.py簡介

二、web.py安裝

2、解壓并進入web.py-0.33目錄,安裝:python setup.py install

三、建立簡易部落格

1、目錄說明:主目錄blog/,模闆目錄blog/templates

3、在主目錄建立blog.py,blog/blog.py

4、在主目錄建立model.py,blog/model.py

5、在模闆目錄依次建立:base.html、edit.html、index.html、new.html、view.html

6、進入主目錄在指令行下運作:python blog.py,将啟動web服務,在浏覽器輸入:http://localhost:8080/,簡易部落格即已完成。