Django的配置文件需要做一些修改。
1. 修改ALLOWED_HOSTS为服务器的ip
ALLOWED_HOSTS = ["***.**.***.**"]
2. 修改Debug = True为False, 配置文件里有醒目的警告:# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
3. 用一下指令把项目跑起来:
nohup python manage.py runserver 0.0.0.0:8000 &
nohup指明服务后台运行,0.0.0.0指明项目跑在本地的127.0.0.1上,8000指明端口