-
Notifications
You must be signed in to change notification settings - Fork 143
Expand file tree
/
Copy pathmanage.py
More file actions
32 lines (23 loc) · 698 Bytes
/
manage.py
File metadata and controls
32 lines (23 loc) · 698 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
#!/usr/bin/env python
import os, sys
sys.path.append(os.path.abspath(os.path.dirname(__file__)))
# from flask.ext.script import Manager, Server
from flask_script import Manager, Server
from OctBlog import create_app
app = create_app(os.getenv('config') or 'default')
# from OctBlog import app
manager = Manager(app)
# Turn on debugger by default and reloader
manager.add_command("runserver", Server(
use_debugger = True,
use_reloader = True,
host = '0.0.0.0',
port = 5000)
)
@manager.command
def test():
import unittest
tests = unittest.TestLoader().discover('tests')
unittest.TextTestRunner(verbosity=2).run(tests)
if __name__ == "__main__":
manager.run()