← Back to blog

Deploying a Django Server to Tencent Cloud

·1 min read

Backend

This is an early study note from 2018. Some of it may be out of date.

  • Set up the Tencent Cloud server

  • The system I chose is Ubuntu Server 16.04.1 LTS 64-bit

  • After logging in, the screen looks like this:

  • Then install Django. Make sure the version matches the one you use for local development.
  • Use screen to keep the Django project running in the background. Note: run runserver with 0.0.0.0:port
  • Connect to the Tencent Cloud server remotely from PyCharm
  • Go to Tools —> Deployment —> Configuration, and you will see the window below

Choose SFTP

  • Enter your IP address here, then click Test SFTP connection
  • Enter your username and password here. You can reset and set the username and password under “More” in the Tencent Cloud console.
  • The connection is now established
  • Now the server’s directory tree appears on the right side of PyCharm (as shown below)
  • Go to home —> ubuntu. You have permissions here, so you can drag your whole project into this folder. Then, on the server, go into the project, create a screen session, and run manage.py runserver 0.0.0.0:port. Your Django site will keep running.