Reputation: 648
I have been reading about the celery
and django
in these posts (here and here), and all the logic/tasks works in the celery.py
, but in the official documentation they separated in two files: celery.py
and tasks.py
. So which is the best practice? This affects the performance?
Upvotes: 1
Views: 134
Reputation: 308809
The location of the tasks shouldn't have any noticeable affect on performance. The suggestion to use a separate tasks.py is for better organization.
From the Celery docs:
Note that this example project layout [a separate tasks.py for each app] is suitable for larger projects, for simple projects you may use a single contained module that defines both the app and tasks, like in the First Steps with Celery tutorial.
Upvotes: 1