title: Starting Celery: AttributeError: 'module' object has no attribute 'celery'
body: <p>I try to start a Celery worker server from a command line:</p>
  
  <pre><code>celery -A tasks worker --loglevel=info
  </code></pre>
  
  <p>The code in tasks.py:</p>
  
  <pre><code>import os
  os.environ[ 'DJANGO_SETTINGS_MODULE' ] = "proj.settings"
  
  from celery import task
  
  @task()
  def add_photos_task( lad_id ):
  ...
  </code></pre>
  
  <p>I get the next error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "/usr/local/bin/celery", line 8, in &lt;module&gt;
      load_entry_point('celery==3.0.12', 'console_scripts', 'celery')()
    File "/usr/local/lib/python2.7/site-packages/celery-3.0.12-py2.7.egg/celery/__main__.py", line 14, in main
      main()
    File "/usr/local/lib/python2.7/site-packages/celery-3.0.12-py2.7.egg/celery/bin/celery.py", line 946, in main
      cmd.execute_from_commandline(argv)
    File "/usr/local/lib/python2.7/site-packages/celery-3.0.12-py2.7.egg/celery/bin/celery.py", line 890, in execute_from_commandline
      super(CeleryCommand, self).execute_from_commandline(argv)))
    File "/usr/local/lib/python2.7/site-packages/celery-3.0.12-py2.7.egg/celery/bin/base.py", line 177, in execute_from_commandline
      argv = self.setup_app_from_commandline(argv)
    File "/usr/local/lib/python2.7/site-packages/celery-3.0.12-py2.7.egg/celery/bin/base.py", line 295, in setup_app_from_commandline
      self.app = self.find_app(app)
    File "/usr/local/lib/python2.7/site-packages/celery-3.0.12-py2.7.egg/celery/bin/base.py", line 313, in find_app
      return sym.celery
  AttributeError: 'module' object has no attribute 'celery'
  </code></pre>
  
  <p>Does anybody know why the 'celery' attribute cannot be found? Thank you for help.</p>
  
  <p>The operating system is Linux Debian 5.</p>
  
  <p><strong>Edit</strong>. May be the clue. Could anyone explain me the next comment to a function (why we must be sure that it finds modules in the current directory)?</p>
  
  <pre><code># from celery/utils/imports.py
  def import_from_cwd(module, imp=None, package=None):
      """Import module, but make sure it finds modules
      located in the current directory.
  
      Modules located in the current directory has
      precedence over modules located in `sys.path`.
      """
      if imp is None:
          imp = importlib.import_module
      with cwd_in_path():
          return imp(module, package=package)
  </code></pre>