-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmanage.py
More file actions
37 lines (26 loc) · 710 Bytes
/
Copy pathmanage.py
File metadata and controls
37 lines (26 loc) · 710 Bytes
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
import os
import unittest
from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager
from app import create_app
from app.api import blueprint
from app.repository.database import db
from app.models.todo import Todo
app = create_app('dev')
db.init_app(app)
app.register_blueprint(blueprint)
app.app_context().push()
manager = Manager(app)
migrate = Migrate(app, db)
manager.add_command('db', MigrateCommand)
@manager.command
def run():
app.run(host=app.config['HOST'],
port=app.config['PORT'],
debug=app.config['DEBUG'])
@manager.command
def test():
import pytest
return pytest.main(['-vx', 'app/tests'])
if __name__ == '__main__':
manager.run()