So in our Django project we're using Celery and the Django-Celery module. The person that originally wrote the tasks section wrote it like so:
from djcelery import celery
@celery.task
def do_something():
...
But everywhere in the docs it shows that we should create a separate celery.py file and import the app like so:
celery.py
from celery import Celery
app = Celery('project')
if __name__=='__main__':
app.run()
tasks.py
from celery import app # Importing `app` from our celery.py
@app.task
def do_something():
...
So I'm wondering if there's a problem doing it one way or the other? We're using django-celery version 3.1