- 第一步 sudo apt-get install supervisor
- 第二步 sudo touch /etc/supervisor/conf.d/myproject.conf
[program:myproject]
command = /usr/bin/python3 /path/manage.py runserver 0.0.0.0:8000
directory = /path
user = xxx
autostart = true
autorestart = true
stdout_logfile = /var/log/supervisor/myproject.log
stderr_logfile = /var/log/supervisor/myproject_err.log
;部署 django 出现编码问题(读取本地文件,中文内容)
;env=DJANGO_SETTINGS_MODULE=settings
env=LC_ALL=zh_CN.UTF-8
- 第三步 service supervisor start
- 第四步 sudo supervisorctl reload
接下来就应启动了
简单的记录一下
By: single430
网友评论