<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>ConnectionError: Error 111 connecting to localhost:6379. Connection refused. // Werkzeug Debugger</title>
<link rel="stylesheet" href="?__debugger__=yes&cmd=resource&f=style.css"
type="text/css">
<!-- We need to make sure this has a favicon so that the debugger does
not by accident trigger a request to /favicon.ico which might
change the application state. -->
<link rel="shortcut icon"
href="?__debugger__=yes&cmd=resource&f=console.png">
<script src="?__debugger__=yes&cmd=resource&f=jquery.js"></script>
<script src="?__debugger__=yes&cmd=resource&f=debugger.js"></script>
<script type="text/javascript">
var TRACEBACK = 140719116431504,
CONSOLE_MODE = false,
EVALEX = true,
EVALEX_TRUSTED = false,
SECRET = "F0EW1BkY3lU19yHpPAZm";
</script>
</head>
<body style="background-color: #fff">
<div class="debugger">
<h1>redis.exceptions.ConnectionError</h1>
<div class="detail">
<p class="errormsg">ConnectionError: Error 111 connecting to localhost:6379. Connection refused.</p>
</div>
<h2 class="traceback">Traceback <em>(most recent call last)</em></h2>
<div class="traceback">
<ul><li><div class="frame" id="frame-140719112032336">
<h4>File <cite class="filename">"/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/flask/app.py"</cite>,
line <em class="line">1836</em>,
in <code class="function">__call__</code></h4>
<div class="source"><pre class="line before"><span class="ws"> </span>'Flask.blueprints instead'), stacklevel=2)</pre>
<pre class="line before"><span class="ws"> </span>return self.blueprints</pre>
<pre class="line before"><span class="ws"></span> </pre>
<pre class="line before"><span class="ws"> </span>def __call__(self, environ, start_response):</pre>
<pre class="line before"><span class="ws"> </span>"""Shortcut for :attr:`wsgi_app`."""</pre>
<pre class="line current"><span class="ws"> </span>return self.wsgi_app(environ, start_response)</pre>
<pre class="line after"><span class="ws"></span> </pre>
<pre class="line after"><span class="ws"> </span>def __repr__(self):</pre>
<pre class="line after"><span class="ws"> </span>return '<%s %r>' % (</pre>
<pre class="line after"><span class="ws"> </span>self.__class__.__name__,</pre>
<pre class="line after"><span class="ws"> </span>self.name,</pre></div>
</div>
<li><div class="frame" id="frame-140719112032848">
<h4>File <cite class="filename">"/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/flask/app.py"</cite>,
line <em class="line">1820</em>,
in <code class="function">wsgi_app</code></h4>
<div class="source"><pre class="line before"><span class="ws"> </span>try:</pre>
<pre class="line before"><span class="ws"> </span>try:</pre>
<pre class="line before"><span class="ws"> </span>response = self.full_dispatch_request()</pre>
<pre class="line before"><span class="ws"> </span>except Exception as e:</pre>
<pre class="line before"><span class="ws"> </span>error = e</pre>
<pre class="line current"><span class="ws"> </span>response = self.make_response(self.handle_exception(e))</pre>
<pre class="line after"><span class="ws"> </span>return response(environ, start_response)</pre>
<pre class="line after"><span class="ws"> </span>finally:</pre>
<pre class="line after"><span class="ws"> </span>if self.should_ignore_error(error):</pre>
<pre class="line after"><span class="ws"> </span>error = None</pre>
<pre class="line after"><span class="ws"> </span>ctx.auto_pop(error)</pre></div>
</div>
<li><div class="frame" id="frame-140719112032976">
<h4>File <cite class="filename">"/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/flask/app.py"</cite>,
line <em class="line">1403</em>,
in <code class="function">handle_exception</code></h4>
<div class="source"><pre class="line before"><span class="ws"> </span># if we want to repropagate the exception, we can attempt to</pre>
<pre class="line before"><span class="ws"> </span># raise it with the whole traceback in case we can do that</pre>
<pre class="line before"><span class="ws"> </span># (the function was actually called from the except part)</pre>
<pre class="line before"><span class="ws"> </span># otherwise, we just raise the error again</pre>
<pre class="line before"><span class="ws"> </span>if exc_value is e:</pre>
<pre class="line current"><span class="ws"> </span>reraise(exc_type, exc_value, tb)</pre>
<pre class="line after"><span class="ws"> </span>else:</pre>
<pre class="line after"><span class="ws"> </span>raise e</pre>
<pre class="line after"><span class="ws"></span> </pre>
<pre class="line after"><span class="ws"> </span>self.log_exception((exc_type, exc_value, tb))</pre>
<pre class="line after"><span class="ws"> </span>if handler is None:</pre></div>
</div>
<li><div class="frame" id="frame-140719112033040">
<h4>File <cite class="filename">"/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/flask/app.py"</cite>,
line <em class="line">1817</em>,
in <code class="function">wsgi_app</code></h4>
<div class="source"><pre class="line before"><span class="ws"> </span>ctx = self.request_context(environ)</pre>
<pre class="line before"><span class="ws"> </span>ctx.push()</pre>
<pre class="line before"><span class="ws"> </span>error = None</pre>
<pre class="line before"><span class="ws"> </span>try:</pre>
<pre class="line before"><span class="ws"> </span>try:</pre>
<pre class="line current"><span class="ws"> </span>response = self.full_dispatch_request()</pre>
<pre class="line after"><span class="ws"> </span>except Exception as e:</pre>
<pre class="line after"><span class="ws"> </span>error = e</pre>
<pre class="line after"><span class="ws"> </span>response = self.make_response(self.handle_exception(e))</pre>
<pre class="line after"><span class="ws"> </span>return response(environ, start_response)</pre>
<pre class="line after"><span class="ws"> </span>finally:</pre></div>
</div>
<li><div class="frame" id="frame-140719112033104">
<h4>File <cite class="filename">"/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/flask/app.py"</cite>,
line <em class="line">1477</em>,
in <code class="function">full_dispatch_request</code></h4>
<div class="source"><pre class="line before"><span class="ws"> </span>request_started.send(self)</pre>
<pre class="line before"><span class="ws"> </span>rv = self.preprocess_request()</pre>
<pre class="line before"><span class="ws"> </span>if rv is None:</pre>
<pre class="line before"><span class="ws"> </span>rv = self.dispatch_request()</pre>
<pre class="line before"><span class="ws"> </span>except Exception as e:</pre>
<pre class="line current"><span class="ws"> </span>rv = self.handle_user_exception(e)</pre>
<pre class="line after"><span class="ws"> </span>response = self.make_response(rv)</pre>
<pre class="line after"><span class="ws"> </span>response = self.process_response(response)</pre>
<pre class="line after"><span class="ws"> </span>request_finished.send(self, response=response)</pre>
<pre class="line after"><span class="ws"> </span>return response</pre>
<pre class="line after"><span class="ws"></span> </pre></div>
</div>
<li><div class="frame" id="frame-140719112033168">
<h4>File <cite class="filename">"/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/flask_api/app.py"</cite>,
line <em class="line">95</em>,
in <code class="function">handle_user_exception</code></h4>
<div class="source"><pre class="line before"><span class="ws"> </span>app_handlers = self.error_handler_spec[None].get(None, ())</pre>
<pre class="line before"><span class="ws"> </span>for typecheck, handler in chain(blueprint_handlers, app_handlers):</pre>
<pre class="line before"><span class="ws"> </span>if isinstance(e, typecheck):</pre>
<pre class="line before"><span class="ws"> </span>return handler(e)</pre>
<pre class="line before"><span class="ws"></span> </pre>
<pre class="line current"><span class="ws"> </span>reraise(exc_type, exc_value, tb)</pre>
<pre class="line after"><span class="ws"></span> </pre>
<pre class="line after"><span class="ws"> </span>def handle_api_exception(self, exc):</pre>
<pre class="line after"><span class="ws"> </span>return APIResponse({'message': exc.detail}, status=exc.status_code)</pre>
<pre class="line after"><span class="ws"></span> </pre>
<pre class="line after"><span class="ws"> </span>def create_url_adapter(self, request):</pre></div>
</div>
<li><div class="frame" id="frame-140719112033232">
<h4>File <cite class="filename">"/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/flask/app.py"</cite>,
line <em class="line">1475</em>,
in <code class="function">full_dispatch_request</code></h4>
<div class="source"><pre class="line before"><span class="ws"> </span>self.try_trigger_before_first_request_functions()</pre>
<pre class="line before"><span class="ws"> </span>try:</pre>
<pre class="line before"><span class="ws"> </span>request_started.send(self)</pre>
<pre class="line before"><span class="ws"> </span>rv = self.preprocess_request()</pre>
<pre class="line before"><span class="ws"> </span>if rv is None:</pre>
<pre class="line current"><span class="ws"> </span>rv = self.dispatch_request()</pre>
<pre class="line after"><span class="ws"> </span>except Exception as e:</pre>
<pre class="line after"><span class="ws"> </span>rv = self.handle_user_exception(e)</pre>
<pre class="line after"><span class="ws"> </span>response = self.make_response(rv)</pre>
<pre class="line after"><span class="ws"> </span>response = self.process_response(response)</pre>
<pre class="line after"><span class="ws"> </span>request_finished.send(self, response=response)</pre></div>
</div>
<li><div class="frame" id="frame-140719112033296">
<h4>File <cite class="filename">"/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/flask/app.py"</cite>,
line <em class="line">1461</em>,
in <code class="function">dispatch_request</code></h4>
<div class="source"><pre class="line before"><span class="ws"> </span># request came with the OPTIONS method, reply automatically</pre>
<pre class="line before"><span class="ws"> </span>if getattr(rule, 'provide_automatic_options', False) \</pre>
<pre class="line before"><span class="ws"> </span>and req.method == 'OPTIONS':</pre>
<pre class="line before"><span class="ws"> </span>return self.make_default_options_response()</pre>
<pre class="line before"><span class="ws"> </span># otherwise dispatch to the handler for that endpoint</pre>
<pre class="line current"><span class="ws"> </span>return self.view_functions[rule.endpoint](**req.view_args)</pre>
<pre class="line after"><span class="ws"></span> </pre>
<pre class="line after"><span class="ws"> </span>def full_dispatch_request(self):</pre>
<pre class="line after"><span class="ws"> </span>"""Dispatches the request and on top of that performs request</pre>
<pre class="line after"><span class="ws"> </span>pre and postprocessing as well as HTTP exception catching and</pre>
<pre class="line after"><span class="ws"> </span>error handling.</pre></div>
</div>
<li><div class="frame" id="frame-140719112033360">
<h4>File <cite class="filename">"/home/jarvis/My projects/Machine Learning/Parags assignment/Mark1_content_based_rec_engine/web.py"</cite>,
line <em class="line">13</em>,
in <code class="function">decorated_function</code></h4>
<div class="source"><pre class="line before"><span class="ws"></span>def token_auth(f):</pre>
<pre class="line before"><span class="ws"> </span>@wraps(f)</pre>
<pre class="line before"><span class="ws"> </span>def decorated_function(*args, **kwargs):</pre>
<pre class="line before"><span class="ws"> </span>if request.headers.get('X-API-TOKEN', None) != current_app.config['API_TOKEN']:</pre>
<pre class="line before"><span class="ws"> </span>abort(403)</pre>
<pre class="line current"><span class="ws"> </span>return f(*args, **kwargs)</pre>
<pre class="line after"><span class="ws"> </span>return decorated_function</pre>
<pre class="line after"><span class="ws"></span> </pre>
<pre class="line after"><span class="ws"></span>@app.route('/predict', methods=['POST'])</pre>
<pre class="line after"><span class="ws"></span>@token_auth</pre>
<pre class="line after"><span class="ws"></span>def predict():</pre></div>
</div>
<li><div class="frame" id="frame-140719112032720">
<h4>File <cite class="filename">"/home/jarvis/My projects/Machine Learning/Parags assignment/Mark1_content_based_rec_engine/web.py"</cite>,
line <em class="line">32</em>,
in <code class="function">train</code></h4>
<div class="source"><pre class="line before"><span class="ws"></span>@app.route('/train')</pre>
<pre class="line before"><span class="ws"></span>@token_auth</pre>
<pre class="line before"><span class="ws"></span>def train():</pre>
<pre class="line before"><span class="ws"> </span>from engine import content_engine</pre>
<pre class="line before"><span class="ws"> </span>data_url = request.data.get('data-url', None)</pre>
<pre class="line current"><span class="ws"> </span>content_engine.train(data_url)</pre>
<pre class="line after"><span class="ws"> </span>return{"message": "Success!", "success": 1}</pre>
<pre class="line after"><span class="ws"></span> </pre>
<pre class="line after"><span class="ws"></span>if __name__ == "__main__":</pre>
<pre class="line after"><span class="ws"> </span>app.debug = True</pre>
<pre class="line after"><span class="ws"> </span>app.run()</pre></div>
</div>
<li><div class="frame" id="frame-140719112032912">
<h4>File <cite class="filename">"/home/jarvis/My projects/Machine Learning/Parags assignment/Mark1_content_based_rec_engine/engine.py"</cite>,
line <em class="line">23</em>,
in <code class="function">train</code></h4>
<div class="source"><pre class="line before"><span class="ws"> </span>start = time.time()</pre>
<pre class="line before"><span class="ws"> </span>ds = pd.read_csv(data_source)</pre>
<pre class="line before"><span class="ws"> </span>info("Training data ingested in %s seconds." %(time.time() - start))</pre>
<pre class="line before"><span class="ws"></span> </pre>
<pre class="line before"><span class="ws"> </span># flush stale training data from redis</pre>
<pre class="line current"><span class="ws"> </span>self._r.flushdb()</pre>
<pre class="line after"><span class="ws"></span> </pre>
<pre class="line after"><span class="ws"> </span>start = time.time()</pre>
<pre class="line after"><span class="ws"> </span>self._train(ds)</pre>
<pre class="line after"><span class="ws"> </span>info("Engine trained in %s seconds" %(time.time() - start))</pre>
<pre class="line after"><span class="ws"></span> </pre></div>
</div>
<li><div class="frame" id="frame-140719112033488">
<h4>File <cite class="filename">"/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/redis/client.py"</cite>,
line <em class="line">644</em>,
in <code class="function">flushdb</code></h4>
<div class="source"><pre class="line before"><span class="ws"> </span>"Delete all keys in all databases on the current host"</pre>
<pre class="line before"><span class="ws"> </span>return self.execute_command('FLUSHALL')</pre>
<pre class="line before"><span class="ws"></span> </pre>
<pre class="line before"><span class="ws"> </span>def flushdb(self):</pre>
<pre class="line before"><span class="ws"> </span>"Delete all keys in the current database"</pre>
<pre class="line current"><span class="ws"> </span>return self.execute_command('FLUSHDB')</pre>
<pre class="line after"><span class="ws"></span> </pre>
<pre class="line after"><span class="ws"> </span>def info(self, section=None):</pre>
<pre class="line after"><span class="ws"> </span>"""</pre>
<pre class="line after"><span class="ws"> </span>Returns a dictionary containing information about the Redis server</pre>
<pre class="line after"><span class="ws"></span> </pre></div>
</div>
<li><div class="frame" id="frame-140719112033616">
<h4>File <cite class="filename">"/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/redis/client.py"</cite>,
line <em class="line">570</em>,
in <code class="function">execute_command</code></h4>
<div class="source"><pre class="line before"><span class="ws"> </span>return self.parse_response(connection, command_name, **options)</pre>
<pre class="line before"><span class="ws"> </span>except (ConnectionError, TimeoutError) as e:</pre>
<pre class="line before"><span class="ws"> </span>connection.disconnect()</pre>
<pre class="line before"><span class="ws"> </span>if not connection.retry_on_timeout and isinstance(e, TimeoutError):</pre>
<pre class="line before"><span class="ws"> </span>raise</pre>
<pre class="line current"><span class="ws"> </span>connection.send_command(*args)</pre>
<pre class="line after"><span class="ws"> </span>return self.parse_response(connection, command_name, **options)</pre>
<pre class="line after"><span class="ws"> </span>finally:</pre>
<pre class="line after"><span class="ws"> </span>pool.release(connection)</pre>
<pre class="line after"><span class="ws"></span> </pre>
<pre class="line after"><span class="ws"> </span>def parse_response(self, connection, command_name, **options):</pre></div>
</div>
<li><div class="frame" id="frame-140719112033680">
<h4>File <cite class="filename">"/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/redis/connection.py"</cite>,
line <em class="line">556</em>,
in <code class="function">send_command</code></h4>
<div class="source"><pre class="line before"><span class="ws"> </span>self.disconnect()</pre>
<pre class="line before"><span class="ws"> </span>raise</pre>
<pre class="line before"><span class="ws"></span> </pre>
<pre class="line before"><span class="ws"> </span>def send_command(self, *args):</pre>
<pre class="line before"><span class="ws"> </span>"Pack and send a command to the Redis server"</pre>
<pre class="line current"><span class="ws"> </span>self.send_packed_command(self.pack_command(*args))</pre>
<pre class="line after"><span class="ws"></span> </pre>
<pre class="line after"><span class="ws"> </span>def can_read(self):</pre>
<pre class="line after"><span class="ws"> </span>"Poll the socket to see if there's data that can be read."</pre>
<pre class="line after"><span class="ws"> </span>sock = self._sock</pre>
<pre class="line after"><span class="ws"> </span>if not sock:</pre></div>
</div>
<li><div class="frame" id="frame-140719112033744">
<h4>File <cite class="filename">"/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/redis/connection.py"</cite>,
line <em class="line">532</em>,
in <code class="function">send_packed_command</code></h4>
<div class="source"><pre class="line before"><span class="ws"> </span>self._sock = None</pre>
<pre class="line before"><span class="ws"></span> </pre>
<pre class="line before"><span class="ws"> </span>def send_packed_command(self, command):</pre>
<pre class="line before"><span class="ws"> </span>"Send an already packed command to the Redis server"</pre>
<pre class="line before"><span class="ws"> </span>if not self._sock:</pre>
<pre class="line current"><span class="ws"> </span>self.connect()</pre>
<pre class="line after"><span class="ws"> </span>try:</pre>
<pre class="line after"><span class="ws"> </span>if isinstance(command, str):</pre>
<pre class="line after"><span class="ws"> </span>command = [command]</pre>
<pre class="line after"><span class="ws"> </span>for item in command:</pre>
<pre class="line after"><span class="ws"> </span>self._sock.sendall(item)</pre></div>
</div>
<li><div class="frame" id="frame-140719112033808">
<h4>File <cite class="filename">"/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/redis/connection.py"</cite>,
line <em class="line">436</em>,
in <code class="function">connect</code></h4>
<div class="source"><pre class="line before"><span class="ws"> </span>return</pre>
<pre class="line before"><span class="ws"> </span>try:</pre>
<pre class="line before"><span class="ws"> </span>sock = self._connect()</pre>
<pre class="line before"><span class="ws"> </span>except socket.error:</pre>
<pre class="line before"><span class="ws"> </span>e = sys.exc_info()[1]</pre>
<pre class="line current"><span class="ws"> </span>raise ConnectionError(self._error_message(e))</pre>
<pre class="line after"><span class="ws"></span> </pre>
<pre class="line after"><span class="ws"> </span>self._sock = sock</pre>
<pre class="line after"><span class="ws"> </span>try:</pre>
<pre class="line after"><span class="ws"> </span>self.on_connect()</pre>
<pre class="line after"><span class="ws"> </span>except RedisError:</pre></div>
</div>
</ul>
<blockquote>ConnectionError: Error 111 connecting to localhost:6379. Connection refused.</blockquote>
</div>
<div class="plain">
<form action="/?__debugger__=yes&cmd=paste" method="post">
<p>
<input type="hidden" name="language" value="pytb">
This is the Copy/Paste friendly version of the traceback. <span
class="pastemessage">You can also paste this traceback into
a <a href="https://gist.github.com/">gist</a>:
<input type="submit" value="create paste"></span>
</p>
<textarea cols="50" rows="10" name="code" readonly>Traceback (most recent call last):
File "/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/flask/app.py", line 1836, in __call__
return self.wsgi_app(environ, start_response)
File "/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/flask/app.py", line 1820, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/flask/app.py", line 1403, in handle_exception
reraise(exc_type, exc_value, tb)
File "/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/flask_api/app.py", line 95, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/jarvis/My projects/Machine Learning/Parags assignment/Mark1_content_based_rec_engine/web.py", line 13, in decorated_function
return f(*args, **kwargs)
File "/home/jarvis/My projects/Machine Learning/Parags assignment/Mark1_content_based_rec_engine/web.py", line 32, in train
content_engine.train(data_url)
File "/home/jarvis/My projects/Machine Learning/Parags assignment/Mark1_content_based_rec_engine/engine.py", line 23, in train
self._r.flushdb()
File "/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/redis/client.py", line 644, in flushdb
return self.execute_command('FLUSHDB')
File "/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/redis/client.py", line 570, in execute_command
connection.send_command(*args)
File "/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/redis/connection.py", line 556, in send_command
self.send_packed_command(self.pack_command(*args))
File "/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/redis/connection.py", line 532, in send_packed_command
self.connect()
File "/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/redis/connection.py", line 436, in connect
raise ConnectionError(self._error_message(e))
ConnectionError: Error 111 connecting to localhost:6379. Connection refused.</textarea>
</form>
</div>
<div class="explanation">
The debugger caught an exception in your WSGI application. You can now
look at the traceback which led to the error. <span class="nojavascript">
If you enable JavaScript you can also use additional features such as code
execution (if the evalex feature is enabled), automatic pasting of the
exceptions and much more.</span>
</div>
<div class="footer">
Brought to you by <strong class="arthur">DON'T PANIC</strong>, your
friendly Werkzeug powered traceback interpreter.
</div>
</div>
<div class="pin-prompt">
<div class="inner">
<h3>Console Locked</h3>
<p>
The console is locked and needs to be unlocked by entering the PIN.
You can find the PIN printed out on the standard output of your
shell that runs the server.
<form>
<p>PIN:
<input type=text name=pin size=14>
<input type=submit name=btn value="Confirm Pin">
</form>
</div>
</div>
</body>
</html>
<!--
Traceback (most recent call last):
File "/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/flask/app.py", line 1836, in __call__
return self.wsgi_app(environ, start_response)
File "/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/flask/app.py", line 1820, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/flask/app.py", line 1403, in handle_exception
reraise(exc_type, exc_value, tb)
File "/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/flask_api/app.py", line 95, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/jarvis/My projects/Machine Learning/Parags assignment/Mark1_content_based_rec_engine/web.py", line 13, in decorated_function
return f(*args, **kwargs)
File "/home/jarvis/My projects/Machine Learning/Parags assignment/Mark1_content_based_rec_engine/web.py", line 32, in train
content_engine.train(data_url)
File "/home/jarvis/My projects/Machine Learning/Parags assignment/Mark1_content_based_rec_engine/engine.py", line 23, in train
self._r.flushdb()
File "/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/redis/client.py", line 644, in flushdb
return self.execute_command('FLUSHDB')
File "/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/redis/client.py", line 570, in execute_command
connection.send_command(*args)
File "/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/redis/connection.py", line 556, in send_command
self.send_packed_command(self.pack_command(*args))
File "/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/redis/connection.py", line 532, in send_packed_command
self.connect()
File "/home/jarvis/anaconda3/envs/crec/lib/python2.7/site-packages/redis/connection.py", line 436, in connect
raise ConnectionError(self._error_message(e))
ConnectionError: Error 111 connecting to localhost:6379. Connection refused.