How to Make Python Manage. Py Runserver Still Running If Terminal Close? [Duplicate]

python manage.py runserver 0.0.0.0:8000
how to make this command running if terminal close

for now i use screen and it works any other way to do that? i mean for production how to link it to ngix or apahce in ubuntu server?

1

You could try to run your Python script with the nohup command infront. Nohup will make the script immume to hangups.

example

nohup python myscript.py &

Your output will be send to nohup.out.

3

Very nice alternative to screen is program called tmux. I use it constantly for daily basis.

Tip:

To dump process into same terminal, runcd any command you'd like, then:

  1. Ctrl + Z - to stop process
  2. write bg - it will dump process to the background
Sarah Jenkins

Sarah Jenkins

Senior Technology Editor & AI Specialist

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.

Share this article
Twitter Facebook Pinterest