title: Celery is connecting to amqp://guest**@localhost instead of Redis. Heroku deploy
body: <p>I have read simillar topics and done everything there was being suggested, but the problem remains. </p>
  
  <p>I am deploying my app to Heroku. Locally everything was working fine, but during deploy after specyfying every setting I could think off to specify the celery worker sends following error: </p>
  
  <blockquote>
    <p>:22:50.722826+00:00 app[worker.1]: [2018-10-21 18:22:50,722: ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 111] Connection refused.</p>
  </blockquote>
  
  <p>I tried switching from CloudAMQP to Redis. And the problem remains. </p>
  
  <p>Here are my config files:</p>
  
  <p><strong>Django's settings.py:</strong>   </p>
  
  <pre><code>try: 
      CELERY_BROKER_URL = os.environ['REDIS_URL']
  except KeyError: 
      CELERY_BROKER_URL = 'amqp://admin:admin@localhost:5672/admin_host'
  
  try:
      CELERY_RESULT_BACKEND = os.environ['REDIS_URL']
  except KeyError:
      CELERY_RESULT_BACKEND = 'amqp://admin:admin@localhost:5672/admin_host'
  
  
  CELERY_ACCEPT_CONTENT = ['json']
  CELERY_TASK_SERIALIZER = 'json'
  CELERY_RESULT_SERIALIZER = 'json'
  
  django_heroku.settings(locals())
  </code></pre>
  
  <p><strong>celery.py</strong></p>
  
  <pre><code>from __future__ import absolute_import, unicode_literals
  import os
  from celery import Celery
  from . import settings
  
  # set the default Django settings module for the 'celery' program.
  os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'file_upload.settings')
  
  app = Celery('file_upload', broker_pool_limit=1)
  
  app.config_from_object('django.conf:settings')
  
  app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
  
  @app.task(bind=True)
  def debug_task(self):
      print('Request: {0!r}'.format(self.request))
  </code></pre>
  
  <p><strong>__init__.py from the package containig celery.py and settings.py:</strong></p>
  
  <pre><code>from __future__ import absolute_import, unicode_literals
  
  # This will make sure the app is always imported when
  # Django starts so that shared_task will use this app.
  from .celery import app as celery_app
  
  __all__ = ['celery_app']
  </code></pre>
  
  <p>and the <code>os.environ['REDIS_URL']</code> does return a url, I checked it.</p>
  
  <p>anyone help?</p>