I have 2 types of task: async tasks and schedule tasks. So, here is my dir structure:
proj
|
-- tasks
|
-- __init__.py
|
-- celeryapp
Based on celery documentation you can import a structure of celery tasks like this:
For example if you have an (imagined) directory tree like this:
|
|-- foo
| |-- __init__.py
| |-- tasks.py
|
|-- bar
|-- __init__.py
|-- tasks.py
Then calling app.autodiscover_tasks(['foo', bar'])
will result in the modules foo.tasks and bar.tasks being imported.