# This is a sample Python script.
# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
from flask import Flask,render_template
app = Flask(__name__)
@app.route('/')
def index():
return render_template("index.html") #目的是调用render_template函数,导入html文件
#Flask在使用render_template函数时会默认调用template下的html文件
#所以需要提前建立一个template文件夹,再在其下建立一个html文件
@app.route("/news")
def news():
return render_template("news.html")
@app.route("/loves")
def loves():
return render_template("loves.html")
@app.route("/dreams")
def dreams():
return render_template("dreams.html")
if __name__=='__main__':
app.run(host="127.0.0.1",port=8080,debug=True)
没有合适的资源?快使用搜索试试~ 我知道了~
基于Flask框架搭建个人网站
共20个文件
jpg:8个
xml:5个
html:4个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 2 下载量 53 浏览量
2023-11-12
10:12:50
上传
评论
收藏 6.64MB ZIP 举报
温馨提示
基于Flask框架搭建个人网站
资源推荐
资源详情
资源评论
收起资源包目录
based-on---flash-master.zip (20个子文件)
based-on---flash-master
pythonProject1
main.py 970B
templates
loves.html 1KB
index.html 2KB
dreams.html 948B
news.html 896B
.idea
workspace.xml 3KB
misc.xml 299B
pythonProject1.iml 291B
inspectionProfiles
Project_Default.xml 421B
profiles_settings.xml 174B
modules.xml 287B
static
img
dreams.jpg 815KB
myself.jpg 558KB
bar.jpg 1.1MB
dreams1.jpg 409KB
sunshine.jpg 2.6MB
she.jpg 265KB
classroom.jpg 875KB
food.jpg 129KB
.gitignore 350B
共 20 条
- 1
资源评论
- ztyang12052024-05-07发现一个超赞的资源,赶紧学习起来,大家一起进步,支持!
- andyyah2023-12-18这个资源总结的也太全面了吧,内容详实,对我帮助很大。
Java程序员-张凯
- 粉丝: 1w+
- 资源: 6749
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功