提交 0af71962 编写于 作者: 梦想橡皮擦's avatar 梦想橡皮擦 💬

初始化爬虫训练场

上级
.idea/
venv/
\ No newline at end of file
from flask import Flask
app = Flask(__name__)
from app import routes
\ No newline at end of file
from flask import render_template
from app import app
@app.route('/')
@app.route('/index')
def index():
item = {
"msg": "后台传递信息"
}
return render_template('index.html', title="梦想橡皮擦", item=item)
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{title}} 爬虫训练场</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
</head>
<body>
<div class="container-fluid p-5 bg-primary text-white text-center">
<h1>这里是爬虫训练场项目</h1>
</div>
<div class="container mt-5">
<div class="row">
<div class="col-sm-4">
<h3>橡皮擦</h3>
<p>Python 实战博客1</p>
</div>
<div class="col-sm-4">
<h3>橡皮擦</h3>
<p>Python 实战博客2</p>
</div>
<div class="col-sm-4">
<h3>橡皮擦</h3>
<p>Python 实战博客3</p>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4"
crossorigin="anonymous"></script>
</body>
</html>
\ No newline at end of file
from app import app
if __name__ == '__main__':
app.run(host='0.0.0.0', port=8888)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册