Skip to content

Commit 8d7845f

Browse files
committed
updated dev.py - now runs by ./dev.py <run|external>
1 parent aaa7262 commit 8d7845f

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

dev.py

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,26 @@
11
#!/usr/bin/env python
22
import sys
33

4+
from flask.ext.script import Manager
5+
46
from handler import app
57

6-
if __name__ == '__main__':
8+
manager = Manager(app)
9+
10+
11+
@manager.command
12+
def run():
713
print app.url_map
8-
if 'external' in sys.argv[1:]:
9-
app.run(host='0.0.0.0')
10-
else:
11-
app.run()
14+
app.run()
15+
16+
@manager.command
17+
def runserver():
18+
run()
19+
20+
@manager.command
21+
def external():
22+
app.run(host='0.0.0.0')
23+
24+
25+
if __name__ == '__main__':
26+
manager.run()

0 commit comments

Comments
 (0)