diff --git a/VersionRecord/v0.0.1.alpha0.0.1.md b/VersionRecord/v0.0.1.alpha0.0.1.md index 1bef086..3543ad2 100644 --- a/VersionRecord/v0.0.1.alpha0.0.1.md +++ b/VersionRecord/v0.0.1.alpha0.0.1.md @@ -2,17 +2,17 @@ ## 需要开发的部分 -`@0001` 系统的登录功能,完成基本的用户数据库创建与登录功能,实现最初的登陆功能 +`@0001` 系统的登录功能,完成基本的用户数据库创建与登录功能,实现最初登陆功能 *`@0002` 系统登录前端* *`@0003` 修改base基类作为模板引用* -`@0004` index界面部署和链接的部署 +*`@0004` index界面部署和链接的部署* -`@0005` 404界面的反馈模板 +*`@0005` 404界面的反馈模板* -`@0006` 500界面的反馈模板 +*`@0006` 500界面的反馈模板* @@ -34,10 +34,8 @@ `&0006` 完成了index的部署 `2023/4/27/20:50` -`&0007` 完成404界面的部署 `2023/4/27/21:00` +`&0007` 完成 404 和 500 界面的部署 `2023/4/27/21:00` ## 需要修复的BUG - -暂无 \ No newline at end of file diff --git a/app.py b/app.py index a51c172..68bedb2 100644 --- a/app.py +++ b/app.py @@ -1,6 +1,8 @@ from flask import Flask, render_template +from blueprint.Login import bp_login app = Flask(__name__) +app.register_blueprint(bp_login) @app.route('/') @@ -8,11 +10,6 @@ def index(): return render_template('index.html') -@app.route('/login') -def login(): - return render_template('login.html') - - @app.errorhandler(404) def page_not_found(e): return render_template('404.html'), 404 diff --git a/blueprint/Login.py b/blueprint/Login.py new file mode 100644 index 0000000..f214b7b --- /dev/null +++ b/blueprint/Login.py @@ -0,0 +1,19 @@ +# -*- coding: UTF-8 -*- +""" +@Project : FlaskProject +@File : Login.py +@IDE : PyCharm +@Author : 爱写屎山的王可奕 +@Email : 1933658780@qq.com +@Date : 2023/4/28 9:12 +@Comment : 登录功能的蓝图 +""" +from flask import Blueprint, render_template + +# 创建蓝图对象 +bp_login = Blueprint('bp_login', __name__) + + +@bp_login.route('/login') +def login(): + return render_template('login.html') diff --git a/blueprint/__init__.py b/blueprint/__init__.py new file mode 100644 index 0000000..ab4e8a5 --- /dev/null +++ b/blueprint/__init__.py @@ -0,0 +1,10 @@ +# -*- coding: UTF-8 -*- +""" +@Project : FlaskProject +@File : __init__.py.py +@IDE : PyCharm +@Author : 爱写屎山的王可奕 +@Email : 1933658780@qq.com +@Date : 2023/4/28 9:11 +@Comment : +""" diff --git a/config.py b/config.py index fbf4381..f2df493 100644 --- a/config.py +++ b/config.py @@ -6,5 +6,5 @@ @Author : 爱写屎山的王可奕 @Email : 1933658780@qq.com @Date : 2023/4/27 15:59 -@Comment : +@Comment : Flask的配置文件 """