Repository navigation
Expand file tree
/
Copy pathmanage.py
More file actions
37 lines (28 loc) · 1.41 KB
/
Copy pathmanage.py
File metadata and controls
37 lines (28 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# -*- coding: utf-8 -*-
"""
manage
~~~~~~~~~~~~
启动app
"""
from flask_script import Manager, Shell
from app import db
from app import create_app
from app import redis_store
from tests import CreateDate
from app.models import User, Role, Follow, Post, PostComment, Course, CourseComment, VideoList, TextResource, \
TextResourceComment, TestList, TestProblem, AnswerRecord, TestRecord, CourseBehavior, TestBehavior,\
TextResourceBehavior, CourseChapter, CourseNode, CourseResource, CourseNodeBehavior
app = create_app()
manager = Manager(app)
def make_shell_context():
return dict(app=app, db=db, User=User, Role=Role, Follow=Follow, Post=Post, PostComment=PostComment,
Course=Course, CourseComment=CourseComment, VideoList=VideoList,
TextResourceComment=TextResourceComment, TextResource=TextResource,
TestList=TestList, TestProblem=TestProblem, AnswerRecord=AnswerRecord,
TestRecord=TestRecord, CourseBehavior=CourseBehavior, TestBehavior=TestBehavior,
TextResourceBehavior=TextResourceBehavior, redis_store=redis_store, CourseResource=CourseResource,
CourseChapter=CourseChapter, CourseNode=CourseNode, CourseNodeBehavior=CourseNodeBehavior)
manager.add_command("shell", Shell(make_context=make_shell_context))
manager.add_command("create_data", CreateDate())
if __name__ == '__main__':
manager.run()