flask使用靜態html
在flask並不是所有的html都需要做成動態html,並且做成動態html在使用靜態資源時要改變它的路徑。所以我們有些可以使用靜態html。
靜態html不需要后台渲染,也就是render_templates.我們直接把html放到static文件夾即可,並且圖片路徑也不需要更改,然后通過路徑訪問。
flask使用動態html
flask動態html,需要在后台進行jinja模板渲染,所以我們要把html文件放到templates文件夾中,然后把需要的靜態資源,css js 圖片等,放到static中。靜態資源使用方式要用url_for()的方式調用