There's an aspect of your situation which isn't entirely clear to me - is this management command one that remains running all the time, like a Celery task would be; or is it one that starts, runs a process for a period of time, and then ends - only to be restarted at a later time? If the former, then yes, running the management command from supervisor makes sense to me. If the latter, then I'd probably be looking at doing something different.
Ken > On April 3, 2018 at 6:15 AM 'Alex' via Django users > <django-users@googlegroups.com> wrote: > > That makes sense. So leave the source as a management command (as it is > now), and just run python manage.py source through supervisor? > > > On Sunday, 1 April 2018 13:16:38 UTC+1, Ken Whitesell wrote: > > > > 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...@googlegroups.com. > > > To post to this group, send email to > > > django...@googlegroups.com. > > > Visit this group at > > > https://groups.google.com/group/django-users > > > 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 > > > > > > https://groups.google.com/d/msgid/django-users/b3c22939-b520-4c9c-90f9-ef8cb7b8c661%40googlegroups.com?utm_medium=email&utm_source=footer > > > . > > > For more options, visit https://groups.google.com/d/optout > > > https://groups.google.com/d/optout . > > > > > > > > > > > > > > > > -- > 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+unsubscr...@googlegroups.com > mailto:django-users+unsubscr...@googlegroups.com . > To post to this group, send email to django-users@googlegroups.com > mailto: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/432d449c-d089-43cd-a739-702847729b6b%40googlegroups.com > > https://groups.google.com/d/msgid/django-users/432d449c-d089-43cd-a739-702847729b6b%40googlegroups.com?utm_medium=email&utm_source=footer > . > For more options, visit https://groups.google.com/d/optout. > -- 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+unsubscr...@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/2038894656.742154.1522760902201%40connect.xfinity.com. For more options, visit https://groups.google.com/d/optout.