跟着麦叔学flask,感谢b站麦叔

This commit is contained in:
2025-12-21 02:38:00 +08:00
parent 582f8a9234
commit 7e44fe8a2a
20 changed files with 690 additions and 0 deletions

54
templates/study/base.html Executable file
View File

@@ -0,0 +1,54 @@
{# base模板 #}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" lang="zh_CN">
<title>{% block title %}{% endblock %}</title>
<!--link rel="stylesheet" href="/static/css/style.css"-->
{# 建立一个url来源于static文件夹的文件名字为css文件夹下的style.css #}
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
</head>
<body>
<div style="width: 100%; background-color: rgb(122, 91, 246);">
<table>
<tr>
<td>
<div class="url">
<a href="/study" class="url">home</a>
</div>
</td>
<td>
<div class="url">
<!--a href="/study/about" class="url">about</a-->
<a href="{{ url_for('study.about')}}" class="url">about</a>
</div>
</td>
<td>
<div class="url">
<a href="/study/posts/new" class="url">新建文章</a>
</div>
</td>
</tr>
</table>
</div>
{% for message in get_flashed_messages() %}
<div>{{ message }}</div>
{% endfor %}
{% block content %} {% endblock %}
</body>
</html>
<style>
body {
margin: 0 0 0 0;
background-color: rgb(157, 209, 255);
}
.url {
height: 40px;
margin: 10px 0 0 10px;
color: rgb(0, 0, 0);
text-decoration: none;
}
</style>