title: celery task decorator throws "TypeError: 'Module object is not callable"
body: <p>I'm trying desperately to get Celery to play nicely with Django, but to no avail. I am getting tripped up on the following:</p>
  
  <p>project/settings.py:</p>
  
  <pre><code>...
  
  import djcelery
  djcelery.setup_loader()
  
  BROKER_URL = 'django://'
  CELERY_RESULT_BACKEND = 'django://'
  CELERY_TASK_SERIALIZER = 'json'
  CELERY_RESULT_SERIALIZER = 'json'
  CELERY_ENABLE_UTC = True
  
  ...
  </code></pre>
  
  <p><em>app/tasks.py:</em></p>
  
  <pre><code>from celery.task import task
  
  @task()
  def scheduled_task(param1, param2):
      ...
      return something
  </code></pre>
  
  <p>Calling <code>scheduled_task(param1, param2)</code> directly (without the decorator) works as expected. However when adding the decorator and firing up the 'development' celery worker like so:</p>
  
  <pre><code>python manage.py celery worker --loglevel=info
  </code></pre>
  
  <p>...I get the following error:</p>
  
  <pre><code>TypeError: 'module' object is not callable
  </code></pre>
  
  <p>I've pinned this down to the <code>@task</code> decorator. Every combination I try fails, including:</p>
  
  <pre><code>from celery import task
  from celery.task import task
  from celery.task.base import task
  
  @task
  @task()
  @task.task
  @task.task()
  @celery.task
  @celery.task()
  </code></pre>
  
  <p>Nothing seems to make any difference to the call stack in the exception, they all <em>appear</em> to think that <code>task</code> is a module, and not callable! To make things even more frustrating:</p>
  
  <pre><code>&gt;&gt;&gt; from celery.task import task
  &gt;&gt;&gt; task
  &lt;function task at 0x10aa2a758&gt;
  </code></pre>
  
  <p>That sure looks callable to me! Any idea what might be happening? If I've missed anything, I'm happy to post additional logs, files or clarify anything else.</p>