title: redis.exceptions.ConnectionError: Error -2 connecting to localhost:6379. Name or service not known
body: <p>I have this error when I run my code in server, my env is debian, and <code>Python2.7.3</code></p>
  
  <pre><code>Traceback (most recent call last):
    File "fetcher.py", line 4, in &lt;module&gt;
      import mirad.fetcher_tasks as tasks
    File "/home/mirad/backend/mirad/fetcher_tasks.py", line 75, in &lt;module&gt;
      redis_keys = r.keys('*')
    File "/home/mirad/backend/venv/local/lib/python2.7/site-packages/redis/client.py", line 863, in keys
      return self.execute_command('KEYS', pattern)
    File "/home/mirad/backend/venv/local/lib/python2.7/site-packages/redis/client.py", line 534, in execute_command
      connection.send_command(*args)
    File "/home/mirad/backend/venv/local/lib/python2.7/site-packages/redis/connection.py", line 532, in send_command
      self.send_packed_command(self.pack_command(*args))
    File "/home/mirad/backend/venv/local/lib/python2.7/site-packages/redis/connection.py", line 508, in send_packed_command
      self.connect()
    File "/home/mirad/backend/venv/local/lib/python2.7/site-packages/redis/connection.py", line 412, in connect
      raise ConnectionError(self._error_message(e))
  redis.exceptions.ConnectionError: Error -2 connecting to localhost:6379. Name or service not known.
  </code></pre>
  
  <p>when I run <code>redis-cli</code> it works correctly without any error:</p>
  
  <pre><code>$ redis-cli 
  127.0.0.1:6379&gt; 
  </code></pre>