Question

Connecting droplet stops web server

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?


Submit an answer

This textbox defaults to using Markdown to format your answer.

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

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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