from chatbot import app if __name__ == '__main__': app.run(debug=True)
from chatbot import app from settings import HOST_NAME, HOST_PORT, DEBUG # run Flask app if __name__ == "__main__": app.run(host=HOST_NAME, port=HOST_PORT, debug=DEBUG)
from chatbot.app import run run()
from chatbot import app if __name__ == "__main__": app.run()
# gunicorn can't find app when it is not named application from chatbot import app as application if __name__ == "__main__": application.run()
import os from chatbot import app if __name__ == '__main__': app.run(host='0.0.0.0', port=int(os.environ.get('PORT', 5000)), debug=True)
'status': 'success', 'interaction': 'Great job, you are done.', 'action': Actions.EndConversation } return jsonr(response) @app.route('/fulfillment_with_error_status', methods=['POST']) def fulfillment_with_error_status(): """Example fulfillment with an error response""" data = request.json dbg('called') dbg(data) response = { 'status': 'error', 'interaction': None, 'status_reason': 'Fulfillment failed' } return jsonr(response) if __name__ == "__main__": if app.config.get('DEBUG', False) and app.config.get('PROFILE', False): from werkzeug.contrib.profiler import ProfilerMiddleware warn('Using Profiler') f = open('/tmp/chatbot_profiler.log', 'w') app.wsgi_app = ProfilerMiddleware(app.wsgi_app, stream=f, restrictions=[20]) app.run(port=9000)
from chatbot import app app.run(host='0.0.0.0', debug=True)