Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8310387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:26:32+00:00 2026-06-08T19:26:32+00:00

I’m trying to follow the documentation to get started with celery, but running into

  • 0

I’m trying to follow the documentation to get started with celery, but running into hard to debug problems with the sample code. I can’t tell if I’m hitting two sides of the same problem, or two unique problems. I can make a connection to the SQS queue through the shell, but not with django. I don’t know what the relation is of that behavior to the problems importing Celery vs importing task.

The “Getting Started” guide here:
http://celery.github.com/celery/getting-started/first-steps-with-celery.html#running-the-celery-worker-server

shows the code

from celery import Celery

This code works if I run it from a python shell, however, if I do that inside my django project in tasks.py in eclipse, I get an error Unresolved Import: Celery.

There is a separate guide here: http://celery.github.com/celery/django/first-steps-with-django.html for django, which instead uses

from celery import task

Which resolves fine, however, when I continue the tutorial and call

add.delay(2, 2)

I get a connection failure, and it looks like maybe it is trying to still use rabbitmq instead of the SQS I have my django project setup to use (which works, I can see the SQS queues from amazon’s web interface, and I can make the connection if I do everything from the shell using from celery import Celery). Here is the stack trace if it is relevant:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/celery/app/task.py", line 343, in delay
    return self.apply_async(args, kwargs)
  File "/usr/local/lib/python2.7/dist-packages/celery/app/task.py", line 458, in apply_async
    with app.producer_or_acquire(producer) as P:
  File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "/usr/local/lib/python2.7/dist-packages/celery/app/base.py", line 247, in producer_or_acquire
    with self.amqp.producer_pool.acquire(block=True) as producer:
  File "/usr/local/lib/python2.7/dist-packages/kombu/connection.py", line 705, in acquire
    R = self.prepare(R)
  File "/usr/local/lib/python2.7/dist-packages/kombu/pools.py", line 54, in prepare
    p = p()
  File "/usr/local/lib/python2.7/dist-packages/kombu/pools.py", line 45, in <lambda>
    return lambda: self.create_producer()
  File "/usr/local/lib/python2.7/dist-packages/kombu/pools.py", line 42, in create_producer
    return self.Producer(self._acquire_connection())
  File "/usr/local/lib/python2.7/dist-packages/celery/app/amqp.py", line 160, in __init__
    super(TaskProducer, self).__init__(channel, exchange, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/kombu/messaging.py", line 83, in __init__
    self.revive(self.channel)
  File "/usr/local/lib/python2.7/dist-packages/kombu/messaging.py", line 174, in revive
    channel = self.channel = maybe_channel(channel)
  File "/usr/local/lib/python2.7/dist-packages/kombu/connection.py", line 879, in maybe_channel
    return channel.default_channel
  File "/usr/local/lib/python2.7/dist-packages/kombu/connection.py", line 617, in default_channel
    self.connection
  File "/usr/local/lib/python2.7/dist-packages/kombu/connection.py", line 610, in connection
    self._connection = self._establish_connection()
  File "/usr/local/lib/python2.7/dist-packages/kombu/connection.py", line 569, in _establish_connection
    conn = self.transport.establish_connection()
  File "/usr/local/lib/python2.7/dist-packages/kombu/transport/amqplib.py", line 279, in establish_connection
    connect_timeout=conninfo.connect_timeout)
  File "/usr/local/lib/python2.7/dist-packages/kombu/transport/amqplib.py", line 90, in __init__
    super(Connection, self).__init__(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/amqplib/client_0_8/connection.py", line 129, in __init__
    self.transport = create_transport(host, connect_timeout, ssl)
  File "/usr/local/lib/python2.7/dist-packages/amqplib/client_0_8/transport.py", line 281, in create_transport
    return TCPTransport(host, connect_timeout)
  File "/usr/local/lib/python2.7/dist-packages/amqplib/client_0_8/transport.py", line 85, in __init__
    raise socket.error, msg
socket.error: [Errno 111] Connection refused

In settings.py, I have the BROKER_URL correctly configured with my SQS url (and no forward slashes in secret code, which apparently has been a problem in the past).

So

  1. Why does “from celery import Celery” work from a python shell, but not in eclipse in the django project?
  2. Why does following the instructions in the django tutorial lead to the connection refused error (and does the amqplib references mean it is trying to use rabbitmq instead of SQS)?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T19:26:33+00:00Added an answer on June 8, 2026 at 7:26 pm

    How do you call the task, are you using manage.py shell?

    Did you add import djcelery; djcelery.setup_loader() to the top of your settings.py?

    The API’s for celery and django-celery are different now because django-celery is lagging behind. Celery 3.1 will support Django out of the box, so the new API can be used everywhere.

    On the eclipse thing that is interesting. Is it possible that Eclipse uses static analysis to find the symbols in a module? In that case, does it help to add the following to the celery/init.py file:

    __all__ = ['Celery']
    

    ?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am currently running into a problem where an element is coming back from
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I am trying to render a haml file in a javascript response like so:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.