Connecting droplet stops web server

January 29, 2015 464 views


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

python runserver

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

The problem is: When i run

python runserver

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?

1 Answer

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
by Justin Ellingwood
In this article, we will discuss how to install and use "screen", a tool that allows you to manage multiple shell sessions inside a single terminal. The screen program is very useful for multi-tasking in an ssh environment, due to its ability to resume terminal sessions and perform multiple-concurrent tasks.
Have another answer? Share your knowledge.