title: Celery configuration for Flask application
body: <p>I have configured Celery to run async jobs for a Flask application on a dev box like this:</p>
  
  <p><strong>config.py:</strong></p>
  
  <pre><code>class CeleryConfig(object):
     CELERY_BROKER_URL = 'redis://localhost:6379/0'
     CELERY_RESULT_BACKEND = 'redis://localhost:6379/0'
  CELERY_CONFIG = CeleryConfig
  </code></pre>
  
  <p><strong>manage.py:</strong></p>
  
  <pre><code>celery_app = celery.Celery(config_source=app.config.get('CELERY_CONFIG'))
  
  def run_celery():
      appl = celery.current_app._get_current_object()
      celery_worker = celery_worker.worker(app=appl)
      options = {
          'broker': config.get('CELERY_CONFIG').CELERY_BROKER_URL,
          'traceback': True,
      }
      celery_worker.run(**options)
  </code></pre>
  
  <p>prior to starting the application I start redis:</p>
  
  <pre><code>./redis-server --daemonize yes
  </code></pre>
  
  <p>Then when I run the application (run_celery) I get the following Celery config displayed:</p>
  
  <ul>
  <li>** ---------- .> transport:   amqp://guest:**@localhost:5672//</li>
  <li>** ---------- .> results:     redis://localhost:6379/0</li>
  </ul>
  
  <p>and the following recurring error:</p>
  
  <blockquote>
    <p>ERROR/MainProcess consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 111] Connection refused.</p>
  </blockquote>
  
  <p>I am not sure why the transport layer is using RabbitMQ and why I can't get Celery started.</p>