title: Django-Celery: importing from another app into project's celery.py file
body: <p>I am following the tutorial on <a href="http://docs.celeryproject.org/en/latest/userguide/periodic-tasks.html" rel="nofollow noreferrer">here</a> to get periodic tasks defined in my django project working.</p>
  
  <p>The article suggests having a <code>celery.py</code> file of the form:</p>
  
  <pre><code>    from celery import Celery
      from celery.schedules import crontab
  
      app = Celery()
  
      @app.on_after_configure.connect
      def setup_periodic_tasks(sender, **kwargs):
              # Calls test('hello') every 10 seconds.
              sender.add_periodic_task(10.0, my_task.s('hello'), name='add every 10')
              )
  
      @app.task
      def my_task(arg):
              print(arg)
  </code></pre>
  
  <p>which works. Now this is good but I don't want to define my tasks locally. my question is, how can I add tasks from other apps?</p>
  
  <p>I have created a blank project called <code>my_proj</code> and it has two apps: <code>my_proj</code> and <code>app_with_tasks</code>. the <code>celery.py</code> file above is at the root level in <code>my_proj</code> app's directory and I want to add periodic tasks from <code>app_with_tasks</code> 's <code>tasks.py</code> file.</p>
  
  <p>I do have <code>app_with_tasks</code> listed in Installed-apps for <code>my_proj</code> settings file but I still can't import anything from an app to anther.</p>
  
  <p>my understanding is that I should use: </p>
  
  <pre><code>from app_with_tasks.tasks import task1
  </code></pre>
  
  <p>but <code>my_proj</code> will then show as unresolved reference in PyCharm. </p>