#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ # @Version : Python 3.11.4 # @Software : Sublime Text 4 # @Author : StudentCWZ # @Email : StudentCWZ@outlook.com # @Date : 2023/11/7 16:16 # @File : task.py # @Description : """ import datetime from application.extensions.init_sqlalchemy import db from application.models import User from application.common import global_config def task(): """ Some Tasks. :return: None """ with db.app.app_context(): print("create user") user = User(username="CWzz", email="Stuu@outlook.com", password="qwe!2345", active=True, created_at=datetime.datetime.utcnow()) user.save() print(db.app.config) print("created user admin")