Access Celery's subprocess in my Django app

29 views
Skip to first unread message

Patricia Infante

unread,
Jan 13, 2017, 7:27:13 AM1/13/17
to Django users
Hi everyone! I put Celery in my Django app so that the two other python programs can process the input from my Django app via doing subprocess method.
My question is how do I access the output from the subprocess? Back then when I made just a python program, I access the log files (output from the two apps) via stdout and stderr. Is this the same when I use Celery in Django? Is the value of CELERY_RESULT_BACKEND (if I should assign my Django app's db here) affected by the log files?

So far what I've done is:
1. Access the two apps via subprocess in my tasks.py
2. I assigned my broker's db, Redis, as my db for now for
CELERY_RESULT_BACKEND. My plan is to get the log files and then save them to my Django app's db so that I can just access that db.

Can you offer some help?

Avraham Serour

unread,
Jan 15, 2017, 12:24:10 AM1/15/17
to django-users
Hi,

In my opinion the celery task should just write to the DB the relevant data, no need to pass around and reprocess just to write the relevant data from the result, the celery task can just import the django model and save directly to the DB.

Usually you don't need to set the CELERY_RESULT_BACKEND

Avraham

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/35c76a39-5291-4153-b651-170409d2e65e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages