PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, August 1, 2022

[FIXED] How to run a Django's application server on a VPS server

 August 01, 2022     django, ubuntu-20.04, vps     No comments   

Issue

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


Solution

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


Answered By - Patrick Acioli
Answer Checked By - Clifford M. (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing