P
P
Pavel Goltsev2014-05-30 13:45:17
PyCharm
Pavel Goltsev, 2014-05-30 13:45:17

Why does PyCharm start 2 copies of runserver when debugging Django?

Hello everyone!
I ran into such a problem that when starting the Django server configuration in PyCharm, for some reason, 2 copies of runserver start. The list of processes gives exactly two different processes of this kind

36857   ??  R      0:01.37 /.../bin/python /.../IntelliJIdea12/python/helpers/pydev/pydevd.py --multiproc --client 127.0.0.1 --port 61418 --file /.../manage.py runserver 8000
36859   ??  S      0:01.75 /.../bin/python /.../IntelliJIdea12/python/helpers/pydev/pydevd.py --multiproc --client 127.0.0.1 --port 61418 --file /.../manage.py runserver 8000

When run from the console with the command python manage.py runserver 127.0.0.1:8000, one process starts. Has anyone encountered this problem? I have a redis pub/sub subscription in django, so running two processes creates two subscriptions, because of this, the other side of the data exchange receives 2 responses each (

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
leclecovich, 2014-05-30
@pesh1983

man ps for your case says:

R    running or runnable (on run queue)
S    interruptible sleep (waiting for an event to complete)
@maxaon hit the spot. Two processes serve to restart the runserver when the code changes. Set the No reload flag in the configuration - there should be one process left.
As a matter of fact, you should also look at and debug the subscription settings, there may be some magic there.

M
maxaon, 2014-05-30
@maxaon

Try to put "Single instance only". Perhaps you run debug and run at the same time, so two processes are created.
However, it is strange that the second process does not crash when it tries to occupy the port.
It is also possible that the process remains hanging when the djanga itself is restarted when files are changed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question