Example #1
0
def main():
    """Main function"""

    parser = argparse.ArgumentParser(description=NAME)
    parser.add_argument('--host',
                        '-H',
                        dest='host',
                        type=str,
                        default=HOSTNAME,
                        required=False,
                        help='Host')
    parser.add_argument('--port',
                        '-P',
                        dest='port',
                        type=int,
                        default=PORT,
                        required=False,
                        help='Port')
    parser.add_argument('--debug',
                        '-D',
                        dest='debug',
                        action='store_true',
                        required=False,
                        help='Debug mode')

    args = parser.parse_args()

    app.run(host=args.host, port=args.port, debug=args.debug, threaded=True)
Example #2
0
def serve(server='127.0.0.1', port=5000, debug=True):
  """ Serves this site.
  """
  if not debug:
    import logging
    file_handler = logging.FileHandler("error.log")
    file_handler.setLevel(logging.WARNING)
    app.logger.addHandler(file_handler)

  #asset_manager.config['ASSETS_DEBUG'] = debug
  app.debug = debug
  app.run(host=server, port=port, debug=debug)
Example #3
0
def serve(server="127.0.0.1", port=5000, debug=True):
    """ Serves this site.
  """
    if not debug:
        import logging

        file_handler = logging.FileHandler("error.log")
        file_handler.setLevel(logging.WARNING)
        app.logger.addHandler(file_handler)

    # asset_manager.config['ASSETS_DEBUG'] = debug
    app.debug = debug
    app.run(host=server, port=port, debug=debug)
Example #4
0
def runserver():
    """Runs the Flask server"""
    if app.debug:
        app.run(host=app.config['HOST'], port=app.config['PORT'])
    else:
        app.wsgi_app = ProxyFix(app.wsgi_app)
        address = app.config['HOST'], app.config['PORT']
        server = WSGIServer(address, app)
        try:
            print("Server running on port %s:%d. Ctrl+C to quit" % address)
            server.serve_forever()
        except KeyboardInterrupt:
            server.stop()
    print("\nBye bye")
Example #5
0
def runserver():
    """Runs the Flask server"""
    if app.debug:
        app.run(host=app.config['HOST'], port=app.config['PORT'])
    else:
        app.wsgi_app = ProxyFix(app.wsgi_app)
        address = app.config['HOST'], app.config['PORT']
        server = WSGIServer(address, app)
        try:
            print("Server running on port %s:%d. Ctrl+C to quit" % address)
            server.serve_forever()
        except KeyboardInterrupt:
            server.stop()
    print("\nBye bye")
Example #6
0
from website.app import app

if __name__ == '__main__':
    app.run(debug=True)
Example #7
0
from website.config import PORT, HOST
from website.app import app

import website.api
import website.routes

app.run(port=PORT, host=HOST)
Example #8
0
from website.app import app

if __name__ == '__main__':
    app.run('0.0.0.0', port=5000, debug=True)
Example #9
0
File: run.py Project: ChenToaff/MDB
from website.app import app
if __name__ == "__main__":
    #create_table()
    app.run(host='0.0.0.0', debug=True)
    
Example #10
0
from website.app import app

if __name__ == "__main__":
    app.run()