0

I am using django-supervisor and my supervisor configuration is here.

Running python manage.py supervisor works great on my 3 Ubuntu machines, but when I try to run it on my mac (10.10), I have 2 problems with django:

  1. If I add print statements in code, I can't see it in the console

  2. If I stop the supervisor and start it again, it says that my django port is already in use and I have to run: lsof -i :8000 | awk '{print $2}' | tail -n +2 | xargs kill every time in order to run the django inside the supervisor.

These 2 problems don't happen on Ubuntu machines.

My Mac is used for dev environment only.

Any ideas how can I fix them?

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
alexarsh
  • 5,123
  • 12
  • 42
  • 51
  • Looks like ``django-supervisor`` is using Django development server instead of a proper web server. This is a recipe for disaster, as the Django development sever is not designed for any production grade usage. I suggest you host Django using uWSGI (https://uwsgi-docs.readthedocs.org/en/latest/ or similar). – Mikko Ohtamaa Jan 15 '15 at 10:37
  • Thanks for the fast reply. The OSX machine is used for dev environment only. Do you say, that in order to use django-supervisor on dev, I still need to use gunicorn or uwsgi instead of just "manage.py runserver"? – alexarsh Jan 15 '15 at 11:38
  • You should be able to develop on it. However I might be missing something here as there must be some need why you need to run django-supervisor on the development server in the first place? Do you use it to start other stuff? In any case I think you can configure supervisor to hardkill Django and the issue here might be caused by the dev server restarting itself in non-supervisor compatible way. My bet is that dev server is not designed to be run as supervised process in the first place. Try disabling dev server automatic restart? – Mikko Ohtamaa Jan 16 '15 at 02:50
  • I want to run it on dev, because I have at least 4 processes, and I don't want to start them one by one when I start my server (check my configuration. In addition I have rabbitmq process). Supervisor is meant to run on dev, otherwise they wouldn't write {% if settings.DEBUG %} in the config file in their README page. And disabling automatic restart doesn't solve the problem. Any more ideas? – alexarsh Jan 18 '15 at 08:16
  • Maybe write to Django developers mailing list and see if they can help with the details. I would simply start other processes with supervisor and dev server separately. – Mikko Ohtamaa Jan 19 '15 at 09:28

0 Answers0