title: How to get Job by id in RQ python?
body: <p>So, basically I want to build a long-polling application which is using RQ on heroku. I have looked at this question <a href="https://stackoverflow.com/questions/12162021/flask-passing-around-background-worker-job-rq-redis">Flask: passing around background worker job (rq, redis)</a> but it doesn't help. </p>
  
  <p>This is basically what I'm doing.</p>
  
  <pre><code>@app.route('/do_something', methods=['POST'])
  def get_keywords():
      data_json = json.loads(request.data)
      text = urllib.unquote(data_json["sentence"])
  
      job = q.enqueue(keyword_extraction.extract, text)
      return job.key
  
  @app.route('/do_something/&lt;job_id&gt;', methods=['GET'])
  def get_keywords_results(job_id):
      job = Job().fetch(job_id)
  
      if(not job.is_finished):
          return "Not yet", 202
      else:
          return str(job.result)
  </code></pre>
  
  <p>Nothing is fancy, so when the POST request comes, it will queue the job and return job_id back to user immidiately, and then user will use the key to keep polling the result. However, I can't seem to get this to work as this line <code>Job().fetch(job_id)</code> returns</p>
  
  <p><code>NoRedisConnectionException: Could not resolve a Redis connection.</code></p>
  
  <p>Any help would be really appreciated. </p>