示例#1
0
def start_server():
    if is_running(get_pid()):
        yellow("Server is already running")
        return

    try:
        open(config.PIDFILE, 'w')
    except IOError:
        red("PID file not writeable (%s) " % config.PIDFILE)
        return

    flags = '--daemon --pid %s' % config.PIDFILE

    green("Server started. Port: %s" % config.PORT)

    config_path = config.get_path()
    if config_path:
        green("Using config: %s" % config_path)
    else:
        yellow("Using default configuration")

    prefix = ''
    if in_virtualenv():
        prefix = get_prefix() + "/bin/"

    Popen("%sgunicorn 'realms:create_app()' -b 0.0.0.0:%s -k gevent %s" %
          (prefix, config.PORT, flags), shell=True, executable='/bin/bash')
示例#2
0
def start_server():
    if is_running(get_pid()):
        yellow("Server is already running")
        return

    try:
        open(config.PIDFILE, 'w')
    except IOError:
        red("PID file not writeable (%s) " % config.PIDFILE)
        return

    flags = '--daemon --pid %s' % config.PIDFILE

    green("Server started. Port: %s" % config.PORT)

    config_path = config.get_path()
    if config_path:
        green("Using config: %s" % config_path)
    else:
        yellow("Using default configuration")

    prefix = ''
    if in_virtualenv():
        prefix = get_prefix() + "/bin/"

    Popen("%sgunicorn 'realms:create_app()' -b 0.0.0.0:%s -k gevent %s" %
          (prefix, config.PORT, flags),
          shell=True,
          executable='/bin/bash')
示例#3
0
def dev(port):
    """ Run development server
    """
    green("Starting development server")

    config_path = config.get_path()
    if config_path:
        green("Using config: %s" % config_path)
    else:
        yellow("Using default configuration")

    create_app().run(host="0.0.0.0", port=port, debug=True)
示例#4
0
def dev(port, host):
    """ Run development server
    """
    green("Starting development server")

    config_path = config.get_path()
    if config_path:
        green("Using config: %s" % config_path)
    else:
        yellow("Using default configuration")

    app.run(host=host, port=port, debug=True)
示例#5
0
def start_server():
    if is_running(get_pid()):
        yellow("Server is already running")
        return

    flags = '--daemon --pid %s' % config.PIDFILE

    green("Server started. Port: %s" % config.PORT)

    config_path = config.get_path()
    if config_path:
        green("Using config: %s" % config_path)
    else:
        yellow("Using default configuration")

    Popen("gunicorn 'realms:create_app()' -b 0.0.0.0:%s -k gevent %s" %
          (config.PORT, flags), shell=True, executable='/bin/bash')
示例#6
0
def start_server():
    if is_running(get_pid()):
        yellow("Server is already running")
        return

    flags = '--daemon --pid %s' % config.PIDFILE

    green("Server started. Port: %s" % config.PORT)

    config_path = config.get_path()
    if config_path:
        green("Using config: %s" % config_path)
    else:
        yellow("Using default configuration")

    Popen("gunicorn 'realms:create_app()' -b 0.0.0.0:%s -k gevent %s" %
          (config.PORT, flags), shell=True, executable='/bin/bash')