リビジョン | 62ca95dad073321eaf135849c7c8dfd8397bee3b (tree) |
---|---|
日時 | 2017-12-30 19:32:15 |
作者 | yamat0jp <yamat0jp@yaho...> |
コミッター | yamat0jp |
if name == ‘main’:
に収めました
@@ -6,9 +6,6 @@ import pymongo | ||
6 | 6 | from datetime import datetime,date |
7 | 7 | import json |
8 | 8 | |
9 | -define("port", default=5000, help="run on the given port", type=int) | |
10 | -options.parse_command_line() | |
11 | - | |
12 | 9 | class BaseHandler(web.RequestHandler): |
13 | 10 | def get_current_user(self): |
14 | 11 | user = self.get_secure_cookie('admin_user') |
@@ -507,9 +504,12 @@ class Application(web.Application): | ||
507 | 504 | if x in name: |
508 | 505 | name.remove(x) |
509 | 506 | return name |
507 | + | |
510 | 508 | if __name__ == '__main__': |
509 | + define("port", default=5000, help="run on the given port", type=int) | |
510 | + options.parse_command_line() | |
511 | 511 | app = Application() |
512 | 512 | conn = pymongo.MongoClient(os.environ['MONGODB_URI'],13678) |
513 | 513 | app.db = conn[os.environ['DB_ACCOUNT']] |
514 | 514 | app.listen(options.port) |
515 | -ioloop.IOLoop.current().start() | |
515 | + ioloop.IOLoop.current().start() |