1、在项目主目录下创建视图文件views.py

django框架编写web网页“hello world”

django框架编写web网页“hello world”

2、在路由文件urls.py里配置视图文件函数

django框架编写web网页“hello world”

3、创建templates文件夹  存放 web 内容样式等

django框架编写web网页“hello world”

在templates文件夹下创建 index.html

django框架编写web网页“hello world”

4、在setting配置文件里   配置templates路径

django框架编写web网页“hello world”

5、运行服务器    打开网页  就可以显示了

django框架编写web网页“hello world”

 

 

 

 

相关文章: