title: Configuration celery with django: app.config_from_object('django.conf:settings') doesn't work
body: <p>First of all, I am using Python 2.7, Django 1.9.12 and Celery 4.0.2 in my project.<br />
  I am following "First steps with Django" Celery tutorial.<br />
  This is my celeryapp.py:</p>
  
  <pre><code>from __future__ import absolute_import, unicode_literals
  import os
  from celery import Celery
  import sys
  
  sys.path.append('vagrant/nested_tree/nested_tree_project')
  
  # set the default Django settings module for the 'celery' program.
  os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'nested_tree_project.settings')
  
  app = Celery('nested_tree_project', broker='amqp://localhost//')
  
  # Using a string here means the worker don't have to serialize
  # the configuration object to child processes.
  # - namespace='CELERY' means all celery-related configuration keys
  #   should have a `CELERY_` prefix.
  app.config_from_object('django.conf:global_settings', namespace='CELERY')
  
  # Load task modules from all registered Django app configs.
  app.autodiscover_tasks()
  </code></pre>
  
  <p><br />
  I can make it work only this way, with global settings</p>
  
  <pre><code>app.config_from_object('django.conf:global_settings', namespace='CELERY')
  </code></pre>
  
  <p><br />
  And I actually cannot access my project settings. If I use</p>
  
  <pre><code>'django.conf:settings'
  </code></pre>
  
  <p>I get an error when I start a celery worker</p>
  
  <pre><code>Traceback (most recent call last):
    File "/vagrant/nested_tree/venv/bin/celery", line 11, in &lt;module&gt;
      sys.exit(main())
    File "/vagrant/nested_tree/venv/local/lib/python2.7/site-packages/celery/__main__.py", line 14, in main
      _main()
    File "/vagrant/nested_tree/venv/local/lib/python2.7/site-packages/celery/bin/celery.py", line 326, in main
      cmd.execute_from_commandline(argv)
    File "/vagrant/nested_tree/venv/local/lib/python2.7/site-packages/celery/bin/celery.py", line 488, in execute_from_com
  mandline
      super(CeleryCommand, self).execute_from_commandline(argv)))
    File "/vagrant/nested_tree/venv/local/lib/python2.7/site-packages/celery/bin/base.py", line 281, in execute_from_comma
  ndline
      return self.handle_argv(self.prog_name, argv[1:])
    File "/vagrant/nested_tree/venv/local/lib/python2.7/site-packages/celery/bin/celery.py", line 480, in handle_argv
      return self.execute(command, argv)
    File "/vagrant/nested_tree/venv/local/lib/python2.7/site-packages/celery/bin/celery.py", line 412, in execute
      ).run_from_argv(self.prog_name, argv[1:], command=argv[0])
    File "/vagrant/nested_tree/venv/local/lib/python2.7/site-packages/celery/bin/worker.py", line 221, in run_from_argv
      return self(*args, **options)
    File "/vagrant/nested_tree/venv/local/lib/python2.7/site-packages/celery/bin/base.py", line 244, in __call__
      ret = self.run(*args, **kwargs)
    File "/vagrant/nested_tree/venv/local/lib/python2.7/site-packages/celery/bin/worker.py", line 255, in run
      **kwargs)
    File "/vagrant/nested_tree/venv/local/lib/python2.7/site-packages/celery/worker/worker.py", line 94, in __init__
      self.app.loader.init_worker()
    File "/vagrant/nested_tree/venv/local/lib/python2.7/site-packages/celery/loaders/base.py", line 116, in init_worker
      self.import_default_modules()
    File "/vagrant/nested_tree/venv/local/lib/python2.7/site-packages/celery/loaders/base.py", line 111, in import_default
  _modules
      return [self.import_task_module(m) for m in self.default_modules]
    File "/vagrant/nested_tree/venv/local/lib/python2.7/site-packages/celery/loaders/base.py", line 97, in import_task_mod
  ule
      return self.import_from_cwd(module)
    File "/vagrant/nested_tree/venv/local/lib/python2.7/site-packages/celery/loaders/base.py", line 106, in import_from_cw
  d
      package=package,
    File "/vagrant/nested_tree/venv/local/lib/python2.7/site-packages/celery/utils/imports.py", line 101, in import_from_c
  wd
      return imp(module, package=package)
    File "/vagrant/nested_tree/venv/local/lib/python2.7/site-packages/celery/loaders/base.py", line 100, in import_module
      return importlib.import_module(module, package=package)
    File "/usr/lib/python2.7/importlib/__init__.py", line 32, in import_module
      raise TypeError("relative imports require the 'package' argument")
  </code></pre>
  
  <p><br />
  What am I doing wrong? I've tried to run python shell from the same directory:</p>
  
  <pre><code>import sys, os, django
  sys.path.append('vagrant/nested_tree/nested_tree_project')
  os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'nested_tree_project.settings')
  django.setup()
  </code></pre>
  
  <p>It works just fine.<br /><br />
  In case it may be useful, this is my project hierarchy:
  <a href="https://i.stack.imgur.com/yFYRv.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yFYRv.jpg" alt="hierarchy"></a></p>