[Django]-How to stop server ran in Daemon mode in Django?

16👍

check the process id of python related to Django

ps -ef | grep python

kill -9 Process_id_no.

2👍

automatically with:

ps -ef|awk 'BEGIN{}{if(match($8, /python/))system("kill -9 " $2)}END{}'
👤whiite

1👍

Nohup.out is the log file from nohup.
What you want is: nohup python manage.py runserver
But nohup introduces it’s own issues, so I’d recommend you use Screen instead.
To use Screen: screen python manage.py runserver once launched you can then disconnect from the session with <Control - D>.
Then if you need to reconnect at some point you can with screen -x.

Leave a comment