6 建立專案 建立資料夾

2021-10-07 07:29:18 字數 664 閱讀 4274

新建public和views資料夾,引入靜態資源檔案。建立空資料夾public存放公共資源,建立views資料夾存放頁面

分別在public裡面建立空資料夾back和web,存放後端和前端檔案

將後端管理系統的資料夾入css、js、images等資料夾放入public下的back資料夾內。將後台的頁面檔案如index.html header.html login.html放入views下的back檔案內。同樣將前台頁面的資料夾如css、js、images等資料夾放入public下的web資料夾內。將前台的頁面檔案如index.html resources.html放入views下的web資料夾內。完成效果如下:

靜態檔案引入進來了,但是頁面的樣式路徑都是錯的。頁面跳轉也是錯誤的。所以,我們需要配置路由。

建立資料夾

當某資料夾不存在時,建立資料夾 import os path dir file if not os.path.exists path dir os.makedirs path dir 同時建立資料夾有兩種函式,os.mkdir和os.makedirs,兩者的區別在於前者是一級一級建立檔案目錄,後者可...

linux c建立資料夾,並在資料夾中建立檔案

建立資料夾,在在檔案裡面建立檔案 乙個例項 include include include include int main char pathname 100 pathname 0 f pathname 1 l pathname 2 o pathname 3 w pathname 4 pathna...

C 建立資料夾,刪除資料夾,建立檔案,刪除檔案

protected void button1 click object sender,eventargs e 判斷檔案的存在 else string name getfiles.filename 獲取已上傳檔案的名字 string size getfiles.postedfile.contentle...