0

I want to host my Django 1.10 web application on WHM(VPS). for that i have installed Django and another necessary tools on WHM(VPS) by ssh login. and i also have uploaded my Django application code through cpanel in public_html directory.

When i run python manage.py runserver <ip_address:8000> from ssh terminal, i am able to access that application. but when i close the ssh terminal, it terminates all the running process. so could not access application after that.

So, Is there any way that without running python manage.py script i can access Django application?

Any help would be highly appreciated.

Thank you.

Nikunj
  • 33
  • 9

1 Answers1

0

Django comes with a built-in development server, it's not really meant to be used when deploying to a remote VPS.

There are some great resources to help you along, but what you're likely going to want to do is deploy your app on a stack using gunicorn or uwsgi as an application server and a web server like Nginx or apache 2 as a reverse proxy.

I personally use Nginx and uwsgi.

There are some great resources explaining how to deploy a Django server. Have a look at this one from digital ocean, it was a great help when I needed to set up a production server correctly: https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-uwsgi-and-nginx-on-ubuntu-16-04

best of luck with it!

beerandsmiles
  • 134
  • 3
  • 12
  • Actually i have already uploaded my code on VPS which has centos6.9 and now i have to complete that deployment on VPS only. so is there any way to host on WHM only? – Nikunj Apr 19 '17 at 10:21
  • I guess the most basic thing you could do is just execute the command from an SSH terminal like this: `python manage.py runserver 0.0.0.0:8000 &` The "&" puts the process into the background and should continue running when you close the terminal. I don't know about using WHM, I'd say you might need to speak to the provider directly since hosting Django usually involves modifying the reverse proxy configs. – beerandsmiles Apr 19 '17 at 10:24