From 2a7ada7458d34325a58f889f507e0a9575f11161 Mon Sep 17 00:00:00 2001 From: cuiweizhi <560397@gree.com.cn> Date: Sat, 11 Nov 2023 16:04:02 +0800 Subject: [PATCH] Update project --- application/config/config.yaml | 2 +- application/libs/tasks/task.py | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/application/config/config.yaml b/application/config/config.yaml index ff912a3..15ee82a 100644 --- a/application/config/config.yaml +++ b/application/config/config.yaml @@ -39,6 +39,6 @@ Redis: DB: 13 Scheduler: - Start: 2023-11-11 15:20:00 + Start: 2023-11-11 15:34:00 End: 2099-11-11 16:00:00 Timezone: Asia/Shanghai diff --git a/application/libs/tasks/task.py b/application/libs/tasks/task.py index 098507d..beda166 100644 --- a/application/libs/tasks/task.py +++ b/application/libs/tasks/task.py @@ -10,6 +10,9 @@ # @Description : """ +from application.extensions.init_sqlalchemy import db +from application.models import User + def task(): """ @@ -17,4 +20,9 @@ def task(): :return: None """ - print(1) + with db.app.app_context(): + print("create user") + user = User(username="CWZ", email="Stu@outlook.com", password="qwe!2345", active=True) + db.session.add(user) + db.session.commit() + print("created user admin") -- GitLab