title: How to connect to redislabs in Python
body: <p>I just signed up for the free account on RedisLabs.com.  I got the endpoint from their website after getting it set up (by clicking &quot;Database&quot; on left hamburger/drop-down menu), then clicking the &quot;checkbox&quot; to the right of my database/server, then there was a field called &quot;endpoint&quot;.  Best I can tell, it is up and running; I didn't see and start/stop, or enable/disable.  My database (or server?) name is just &quot;Demo&quot;; I don't think I need to specify that in the Python code as long as as I have the endpoint, correct?</p>
  <p>I couldn't find any place I was supposed to whitelist IP Addreses, but suspect that might be the issue.  Since the host was after the colon on the end, I didn't specify &quot;host=&quot; in my connection in the code below.</p>
  <p>My Python test program (I used the endpoint they gave me, but in the code below I just put their sample one).</p>
  <pre><code>import redis
  import json
  import pprint
  
  host_info = &quot;redis.us-east-1-1.ec2.cloud.redislabs.com:18274&quot;
  redisObj = redis.Redis(host=host_info, password='xxx')
  
  capitals = {
       &quot;Lebanon&quot;: &quot;Beirut&quot;,
       &quot;Norway&quot;: &quot;Oslo&quot;,
       &quot;France&quot;: &quot;Paris&quot;
   }
  print (&quot;capitals - before call to Redis&quot;)
  pprint.pprint(capitals)
  
  print (&quot;call to Redis&quot;)
  redisObj.execute_command('JSON.SET', 'doc', ',', json.dumps(capitals))
  print(&quot;Data Saved, now fetch data back from redis&quot;)
  reply = json.loads(redisObj.execute_command('JSON.GET', 'doc'))
  print (&quot;reply from Redis get&quot;)
  pprint.pprint(reply)
  </code></pre>
  <p>Error:</p>
  <pre><code>  File &quot;C:\Users\nwalt\.virtualenvs\TDAmeritradeGetQuotes\lib\site-packages\redis\connection.py&quot;, line 563, in connect
      raise ConnectionError(self._error_message(e))
  redis.exceptions.ConnectionError: Error 11001 connecting to redis.us-east-1-1.ec2.cloud.redislabs.com:18274:6379. getaddrinfo failed.
  </code></pre>
  <p>From the command line, I also tried:
  redis-cli -h redis.us-east-1-1.ec2.cloud.redislabs.com:18274</p>
  <p>It gives error:
  Could connect to Redis at ..... can't resolve: ....</p>