Пример #1
0
from services import app, api
import os

if __name__ == '__main__':
    port = int(os.environ.get('PORT', '5000'))
    debug = bool(os.environ.get('DEBUG', 'False').lower() == 'true')
    app.run(host='0.0.0.0', port=port, debug=debug)
Пример #2
0
from services import app
if __name__ == "__main__":
    app.run()
    #app.run(debug=True, host="0.0.0.0")
Пример #3
0
@app.errorhandler(400)
def bad_request(error):
    return response(code=RetCode.PARAMS_ERROR)


@app.errorhandler(404)
def api_not_found(error):
    return response(code=RetCode.ENTRY_NOT_FOUND)


@app.errorhandler(500)
def server_error(error):
    data = {
        'sentry_event_id': g.sentry_event_id,
        'public_dsn': sentry.client.get_public_dsn('http'),
        'error': str(error)
    }
    return response(data, RetCode.SERVER_ERROR)


@app.route('/')
def hello_world():
    return response(data='Hello!')


app.register_blueprint(message_api, url_prefix='/demo')

if __name__ == '__main__':
    app.run()
Пример #4
0
from services import app

if __name__ == "__main__":
    app.run(host="0.0.0.0", debug=True)
Пример #5
0
#! /usr/bin/env python
from services import app

app.config.from_object('config')
if __name__ == "__main__":
    app.run(debug=True, host='192.168.0.174' )
Пример #6
0
from services import app
app.run(host='0.0.0.0', port=int("7001"), debug=True, threaded=True)
Пример #7
0
def runserver(host, port, debug):
    app.run(host=host, port=port, debug=debug)
Пример #8
0
from services import app
app.run(debug=True)