標籤:靜態檔案 資料 space quit div idv d3d number net
Centos7.2 上 對 sqlite 的學習
打算學習一下非常簡單的資料庫使用方法。
參考http://www.runoob.com/sqlite/sqlite-tutorial.html
一、準備工作
可能需要先安裝 centos 上的sqlite,這裡嘗試’sudo yum install sqlite’,被提示已存在。
用Python安裝一個 sqlite-api 的庫,pip install sqlite3。被提示不支援我現在的Python版本(2.7.6)。
二、建立資料庫
cd到自己想要存放 comment.db 的目錄,使用如下命令。
[[email protected]2-0001 home]# sqlite3 comment.dbSQLite version 3.7.17 2013-05-20 00:56:22Enter ".help" for instructionsEnter SQL statements terminated with a ";"sqlite>.quit #退出資料庫
使用上面的語句就建立成功了comment.db。sourceCRT的7.0.0 32bit 漢化版本真難用,一直掉線沒反應。
參考1 http://www.oschina.net/translate/the-flask-mega-tutorial-part-i-hello-world 這篇翻譯挺好的。
參考2 https://www.linuxhub.org/?p=2473 。
四種資料庫的flask-sqlalchemy配置參考https://www.cnblogs.com/agmcs/p/4445583.html
三、在 flask manage.py 中的應用
(目前存在的問題:通過外網無法訪問我的靜態檔案,可能是因為我沒放到static/目錄下。如果放了也不行,可能需要考慮nginx的配置問題?)
參考
網頁HTMLhttp://v3.bootcss.com/components/#navbar-brand-image,喜歡這種簡約風格。
待辦
?
Centos7.2 上 對 sqlite 的學習