Sunday, April 1, 2018

Re: How to run an external command that must run with the server

We set up all our Django-related processes as a group under supervisor. This includes our celery-based processes. (We have some long-running tasks that are kicked off by the web site.) By setting it up as a group, we can manage all the different processes as a set.

Whether or not that's the "best" way is possibly debatable. But it works for us and doesn't give us any problems.

Ken

On 4/1/2018 7:06 AM, 'Alex' via Django users wrote:
I have a daphne server running a django channels application. I also have a python script that aggregates data from various sources, and sticks it into the channel layer (called source.py). At the moment, I run it as a management command (python manage.py source). It is nearly time for deployment(!), so I'm moving towards production solutions. Daphne itself currently runs under supervisor.

My question is, what is the best way to run source.py? As a management command, also under supervisor? Using celery? In some other way? Since source.py feeds into the channel layer, it needs access to settings.py in order to identify the details of the channel layer etc.
--
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-users@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/b3c22939-b520-4c9c-90f9-ef8cb7b8c661%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


No comments:

Post a Comment