-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanage.py
34 lines (27 loc) · 849 Bytes
/
manage.py
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
"""
manage.py
- provides a command line utility for interacting with the
application to perform interactive debugging and setup
"""
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
from near_u.application import create_app
from near_u.models import db, User, Sensor, Condition, Task, Configuration
app = create_app()
migrate = Migrate(app, db)
manager = Manager(app)
# provide a migration utility command
manager.add_command('db', MigrateCommand)
# enable python shell with application context
@manager.shell
def shell_ctx():
return dict(app=app,
db=db,
User=User,
Sensor=Sensor,
Condition=Condition,
Task = Task,
Configuration = Configuration
)
if __name__ == '__main__':
manager.run()