title: Why does Celery work in Python shell, but not in my Django views? (import problem)
body: <p>I installed Celery (latest stable version.)
  I have a directory called <code>/home/myuser/fable/jobs</code>.  Inside this directory, I have a file called tasks.py:</p>
  
  <pre><code>from celery.decorators import task
  from celery.task import Task
  
  class Submitter(Task):
      def run(self, post, **kwargs):
          return "Yes, it works!!!!!!"
  </code></pre>
  
  <p>Inside this directory, I also have a file called celeryconfig.py:</p>
  
  <pre><code>BROKER_HOST = "localhost"
  BROKER_PORT = 5672
  BROKER_USER = "abc"
  BROKER_PASSWORD = "xyz"
  BROKER_VHOST = "fablemq"
  
  CELERY_RESULT_BACKEND = "amqp"
  CELERY_IMPORTS = ("tasks", )
  </code></pre>
  
  <p>In my <code>/etc/profile</code>, I have these set as my PYTHONPATH:</p>
  
  <ul>
  <li><code>PYTHONPATH=/home/myuser/fable:/home/myuser/fable/jobs</code></li>
  </ul>
  
  <p>So I run my Celery worker using the console (<code>$ celeryd --loglevel=INFO</code>), and I try it out.
  I open the Python console and import the tasks.  Then, I run the Submitter.</p>
  
  <pre><code>&gt;&gt;&gt; import fable.jobs.tasks as tasks
  &gt;&gt;&gt; s = tasks.Submitter()
  &gt;&gt;&gt; s.delay("abc")
  &lt;AsyncResult: d70d9732-fb07-4cca-82be-d7912124a987&gt;
  </code></pre>
  
  <p>Everything works, as you can see in my console</p>
  
  <pre><code>[2011-01-09 17:30:05,766: INFO/MainProcess] Task tasks.Submitter[d70d9732-fb07-4cca-82be-d7912124a987] succeeded in 0.0398268699646s:
  </code></pre>
  
  <p>But when I go into my Django's views.py and run the exact 3 lines of code as above, I get this:</p>
  
  <pre><code>[2011-01-09 17:25:20,298: ERROR/MainProcess] Unknown task ignored: "Task of kind 'fable.jobs.tasks.Submitter' is not registered, please make sure it's imported.": {'retries': 0, 'task': 'fable.jobs.tasks.Submitter', 'args': ('abc',), 'expires': None, 'eta': None, 'kwargs': {}, 'id': 'eb5c65b4-f352-45c6-96f1-05d3a5329d53'}
  Traceback (most recent call last):
    File "/home/myuser/mysite-env/lib/python2.6/site-packages/celery/worker/listener.py", line 321, in receive_message
      eventer=self.event_dispatcher)
    File "/home/myuser/mysite-env/lib/python2.6/site-packages/celery/worker/job.py", line 299, in from_message
      eta=eta, expires=expires)
    File "/home/myuser/mysite-env/lib/python2.6/site-packages/celery/worker/job.py", line 243, in __init__
      self.task = tasks[self.task_name]
    File "/home/myuser/mysite-env/lib/python2.6/site-packages/celery/registry.py", line 63, in __getitem__
      raise self.NotRegistered(str(exc))
  NotRegistered: "Task of kind 'fable.jobs.tasks.Submitter' is not registered, please make sure it's imported."
  </code></pre>
  
  <p>It's weird, because the celeryd client does show that it's registered, when I launch it.</p>
  
  <pre><code>[2011-01-09 17:38:27,446: WARNING/MainProcess]  
  Configuration -&gt;
      . broker -&gt; amqp://GOGOme@localhost:5672/fablemq
      . queues -&gt;
          . celery -&gt; exchange:celery (direct) binding:celery
      . concurrency -&gt; 1
      . loader -&gt; celery.loaders.default.Loader
      . logfile -&gt; [stderr]@INFO
      . events -&gt; OFF
      . beat -&gt; OFF
      . tasks -&gt;
          . tasks.Decayer
          . tasks.Submitter
  </code></pre>
  
  <p>Can someone help?</p>