Home > Mobile >  How to run a Django's application server on a VPS server
How to run a Django's application server on a VPS server

Time:04-22

I have an application that should run via VPS terminal-based so that the web app can be online permanently. The command: python manage.py runserver 173.249.8.237:8000 should be executed via the VPS terminal because when I use putty via my laptop, whenever I switch off my putty software via my laptop, the application won't be accessible. Please, suggest to me a way open a terminal in order to run the Django application server. Or, is there any method that can allow me to my Django web application on VPS?

Thanks in advence

CodePudding user response:

Don't do that.

runserver according Django Docs

DO NOT USE THIS SERVER IN A PRODUCTION SETTING. It has not gone through security audits or performance tests. (And that’s how it’s gonna stay. We’re in the business of making web frameworks, not web servers, so improving this server to be able to handle a production environment is outside the scope of Django.)

You need to configure your Django application to run in production environments. You change choose docker for that.

Or simple running with gunicorn.

  1. Access your VPS through SSH or Putty.
  2. Copy your application code inside VPS
  3. Configure your application to run with gunicorn or docker
  4. Access your VPS address in your browser.
  5. And turn of the DEBUG mode, by setting DEBUG=False
  • Related