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')
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)
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)
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')