contos7自启动django服务

研究了很多种办法

1.新建一个sh 文件

vi django_autostart.sh 

2.编辑文件内容

#!/bin/bash

#chkconfig:345 61 61 //此行的345参数表示,在哪些运行级别启动,启动序号(S61);关闭序号(K61)

#description:django //此行必写,描述服务.

 

nohup python /root/xinfang/manage.py runserver 0.0.0.0:8000 &

 

3、移动文件到

mv django_autostart.sh /etc/rc.d/init.d/django_autostart.sh

 

4、

 

posted on 2019-11-02 23:07  耀扬  阅读(502)  评论(0编辑  收藏  举报

导航