From: Matt Webb Date: Sat, 27 Sep 2014 14:15:20 +0000 (+0100) Subject: tweaking to see logs on heroku X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=ac760a54d1fce16ebd20aecbaec1ecef681726ec;p=sirius.git tweaking to see logs on heroku --- diff --git a/app/__init__.py b/app/__init__.py index b20971a..bf8e69d 100755 --- a/app/__init__.py +++ b/app/__init__.py @@ -7,6 +7,7 @@ from config import config from pprint import pprint import json import gevent +import sys bootstrap = Bootstrap() db = SQLAlchemy() @@ -16,9 +17,9 @@ sockets = Sockets() # for this to work, I have to put the following line at line 38 of # flask_sockets, to inject it into the environment # environment.environ['HTTP_SEC_WEBSOCKET_PROTOCOL'] = 'bergcloud-bridge-v1' -def protocol_name(): - print "asked for protocol" - return 'bergcloud-bridge-v1' +#def protocol_name(): +# print "asked for protocol" + # return 'bergcloud-bridge-v1' def create_app(config_name): app = Flask(__name__) @@ -30,7 +31,7 @@ def create_app(config_name): sockets.init_app(app) # maybe this sets the HTTP_SEC_WEBSOCKET_PROTOCOL ? - app.protocol_name = protocol_name + #app.protocol_name = protocol_name # attach routes and custom error pages from .main import main as main_blueprint @@ -51,6 +52,7 @@ def create_app(config_name): @sockets.route('/api/v1/connection') def coresocket(ws): print "here" + sys.stdout.flush() while True: message = ws.receive() #pprint(message) diff --git a/config.py b/config.py index dfb1eb5..aa769fb 100755 --- a/config.py +++ b/config.py @@ -25,6 +25,7 @@ class ProductionConfig(Config): class HerokuConfig(ProductionConfig): SSL_DISABLE = bool(os.environ.get('SSL_DISABLE')) + DEBUG = True @classmethod def init_app(cls, app): diff --git a/manage.py b/manage.py index 297bced..a67703e 100755 --- a/manage.py +++ b/manage.py @@ -30,7 +30,7 @@ def deploy(): # migrate database to latest revision upgrade() - + if __name__ == '__main__': manager.run()