1

I have Very Comman issue might looks easy.I have Pushed my Django project on Live Digital Ocean server.I have done all the Configuration using Putty terminal.My project is Working Fine but when i close my Terminal,Project stopped working.I am using Digital Ocean Server.my Question is How to Keep Project Running after closing terminal? i will be Thankful if anyone can Help me with this issue.

3
  • 2
    You don't say explicitly how you're starting your application, but i am going to assume that you are using the runserver management command. If so, you should look into using gunicorn or similar to serve the application in production. This is reasonably straightforward and is "best practice". Plus it will fix your issue! Commented Oct 14, 2020 at 10:20
  • 1
    digitalocean.com/community/tutorials/… have a look here to set up your app with gunicorn, postgres, nginx . It is very well explained.
    – barbaart
    Commented Oct 14, 2020 at 10:37
  • Django's Deploying Django guide is important to read before running your app on a publicly accessible server.
    – D Malan
    Commented Oct 14, 2020 at 13:05

3 Answers 3

1

You can use nohup command to run a command or shell-script even after you logout.

nohup command
1

If you're just testing your application in development and you don't want to set up a production server as @PirateNinjas and @barbaart have suggested you which is the most secure thing to do. Then you can try to run the runserver command in the builtin console that your digitalocean's droplet has. Take a look here https://www.digitalocean.com/docs/droplets/resources/console/. It'll open a console in a separate browser and after you run the runserver command you can close it. Good luck!

-1

Im using Tmux - multisession terminal processor.