What should I do to keep my website server on even though my computer is off?

0

I clicked 'connect using SSH' button and after that, I typed python manage.py runserver 0:8000. I expected the website to be accessible all the time when I just type that once, but if I don't keep my computer on and press refresh button every 30 seconds, I can't access the site. I should type same sentences every time to keep my site accessible. What should I do to keep my website server on even though my computer is off? I'm a student and not a professional so I'm expecting kind and easy answers. Thank you.

1 réponse
2
Réponse acceptée

The easiest way would be to use nohup

nohup python manage.py runserver 0:8000 &

You can verify that it's indeed working by exiting the SSH session and connecting back again. Then verify with ps command that it is yet running

ps ax | grep python

--Syd

profile picture
Syd
répondu il y a 2 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions