https://code.visualstudio.com/docs/python/tutorial-django#_use-a-template-to-render-a-page
通过模板渲染页面 文件
实现步骤
1, 修改代码,hello的App名字增加到installed_apps表中。

2, hello子目录下,创建 .\templates\hello的子目录。
3,在templates\hello目录下创建 hello_there.html文件。

该文件中包含了两个占位符,name和date。这样程序只需要传递name和date两个数值就可以。
4, 修改views.py文件

引入render,更改hello_there子程序的内容。
运行结果:

关于静态文件 CSS文件
准备环境
修改web_project中urls.py文件。

模板中引用静态文件 ref to static files in template
1, hello 目录(相当于hello app)中创建 static的目录
2,static目录中创建hello子目录(与app名字相同)
3,在static\hello中创建文件: site.css
内容如下:

4, 修改hello_there.html文件 titile中增加 load static声明
5,修改hello_there.html文件body 部分
修改如下:

运行结果:

增加字体颜色渲染。
收集项目相关的所有CSS文件
1,web_project中settings.py文件 增加一行定义收集CSS文件的位置。区分大小写。

2,运行terminal命令

目录如下:

页面继承
过程
1,在hello/templates/hello目录中创建layout.html文件。内容如下。title和content需要别的页面来提供信息。

2,在hello/static/hello/site.css文件中增加一下内容,用于渲染。

3,hello/templates/hello目录下创建home.html
内容如下:

4,同样创建about.html

5, 创建contact.html文件。
6, 修改hello文件夹下面的 urls.py

7,修改 hello文件夹下面的views.py 重写home,about,contact子程序。

结果













![cookie伪造 [BSidesCF 2019]Kookie1](https://img-blog.csdnimg.cn/direct/1ddb7336cd3d47fbadd7a94ec921dffe.png)






![[C#]winform基于opencvsharp结合pairlie算法实现低光图像增强黑暗图片变亮变清晰](https://img-blog.csdnimg.cn/direct/faf01fde3bbe4fc18bc9291aed043d4e.jpeg)
