How to save Celery data into Django DB

I'm running a Django app on AWS, with a PostgreSQL DB, using SQS. I'm trying to offload the montecarlo simulation onto Celery, but I am unable to save the results to my DB.

My view looks like:


The task looks like:

def runMonteCarloAsync(self,checkedCompaniesIDs):
    # Do some montecarlo stuff
    data = []
    newResults = MonteCarloResultTrue(data=data)

Here is my

CELERY_accept_content = ['application/json']
CELERY_task_serializer = 'json'
CELERY_TASK_DEFAULT_QUEUE = 'django-queue-dev'
CELERY_BROKER_URL = 'sqs://{0}:{1}@'.format(
    urllib.parse.quote(AWS_ACCESS_KEY_ID, safe=''),
    urllib.parse.quote(AWS_SECRET_ACCESS_KEY, safe='')
    "region": "us-east-1",
    'polling_interval': 20
CELERY_CACHE_BACKEND = 'django-cache'


web: python runserver
celery_worker: celery worker -A --concurrency=1 --loglevel=INFO -n worker.%%h
celery_beat: celery

I can see the messages hitting SQS: enter image description here

There are no new DB entires. I feel like I'm missing something, but I can't figure it out.

Back to Top