title: Canonical Celery single file hello world
body: <p>I cannot seem to find a single file anywhere online that will run from start to finish with Celery and Python to demonstrate it so I tried to make one. For some reason this is not working, I am new to Celery. In <code>test_celery.py</code> I added the content below:</p>
  
  <pre><code>from celery import Celery
  import time
  
  app = Celery(
      'test_celery'
      ,broker= 'redis://localhost/0',
      backend='redis://localhost/1'
  )
  
  @app.task
  def add(x, y):
      time.sleep(2)
      return x + y
  
  if __name__ == '__main__':
      result = add.delay(4, 4)
      print( result.get() )
  </code></pre>
  
  <p>Then I ran the redis server on localhost and at the console entered:</p>
  
  <pre><code>celery -A test_celery worker --loglevel=info
  </code></pre>
  
  <p>So, now the worker is listening and I try to run <code>python test_celery.py</code> thinking that I should see my wonderful 8 in the console output. In the log of the worker console, I see <code>[2015-01-02 16:53:08,807: INFO/MainProcess] Task test_celery.add[2c6b19c0-3a3f-45d2-8024-64e112fa3419] succeeded in 1.9970000002067536s: 8</code> which is as expected but the call to <code>result.get</code> hangs in the main program console. </p>
  
  <p>I must be missing something basic here, if anyone could help that would be great. </p>