Question

Connecting droplet stops web server

  • Posted January 29, 2015

Hello,

I have a Python Django application runing on my droplet. I run it via command

python manage.py runserver 127.0.0.1:8001

And i have nginx server forwarding requests to that local server. Everything is runing smoothly.

The problem is: When i run

python manage.py runserver 127.0.0.1:8001

command, i can’t do anything else, or if i reconnect it using ssh my local server stops. How can i make it run all the time at background?

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

You can do this with screen. This tutorial walks you through the details.

In short you can install screen with:

apt-get update;
apt-get install screen;

Then run

screen -S "my service"

And run your Django app. Once it is up and running press ctrl+a d to disconnect from the screen session. This leaves your app running while freeing up the console for other work. When you want to reconnect to your screen session to manage your running Django app or to stop it you can run

screen -R