服务器重启后如何重启Django应用程序?

时间:2018-04-02 18:18:48

标签: django digital-ocean django-deployment

我已经使用gunicorn + nginx + postgres部署了Django应用程序。我正在使用digitalocean ubuntu server.Which有时会在一个月内自动重新启动,以便应用程序停止运行。如何自动重启应用程序? 我的启动脚本:

#!/bin/bash
#activate virtual env
echo Activate vitualenv.
source /home/wrangler_env/bin/activate


#restart database
#echo restarting database
#sudo service postgresql restart
# Start Gunicorn processes
echo Starting Gunicorn.
gunicorn wrangler.wsgi:application --bind=0.0.0.0:1312 --daemon


#restart nginx
echo Restarting Nginx
service nginx restart

此脚本在服务器自动重启后重新手动运行。

0 个答案:

没有答案