1

I have tried to run a xmpp process along with django server, so i included the xmpp process in manage.py so that both of them run simultaneoulsy. Now I have a problem that xmpp process is in an infinite loop and so django server wont start until I break the loop which isn't the task I wanted to do.

Is there a way so that I can run them simultaneously.

Ching Chong
  • 723
  • 1
  • 8
  • 20

1 Answers1

1

Your problem is probably that the XMPP process expects to be the only thread in the process, and so it blocks waiting for input.

You might be able to get around the problem by creating a new thread that then runs the XMPP process, see http://www.devshed.com/c/a/Python/Basic-Threading-in-Python/1/ Be aware that there might be other interactions between the XMPP process and Django that will lead to problems, because they share the same address space.

If you just want to start some process whenever you run the Django server, see: How do I run another script in Python without waiting for it to finish?

Community
  • 1
  • 1
mchro
  • 46
  • 4