def user(username): item = TestModel(id='1') item.text=str(username) print(item.text) return '<h1>welcome! %s</h1>' % username
import sys sys.path.append('D:\\PycharmProjects\\FlaskBlog') from model import TestModel test = TestModel(testid='1') test.text='test1' test.save()