使用cron启动django项目
我有一个Django项目,我想每次重新启动设备时都需要开始。我可以使用以下4个命令手动启动Django应用程序,
cd /home/pi/reg-sign
source djenv/bin/activate
cd /home/pi/reg-sign/mysite
python manage.py runserver 192.168.4.1:8000
但是我无法在crontab行中使用此功能。
到目前为止
@reboot cd /home/pi/reg-sign && /home/pi/reg-sign/djenv/bin/python /home/pi/reg-sign/mysite/manage.py python runserver 192.168.4.1:8000
但是,这不会启动服务器。
任何帮助都将不胜感激。
非常感谢
I have a Django project which I want to start every time the device reboots. I can start the Django application manually using the following 4 commands
cd /home/pi/reg-sign
source djenv/bin/activate
cd /home/pi/reg-sign/mysite
python manage.py runserver 192.168.4.1:8000
But I cannot get this working in a crontab line.
So far I have;
@reboot cd /home/pi/reg-sign && /home/pi/reg-sign/djenv/bin/python /home/pi/reg-sign/mysite/manage.py python runserver 192.168.4.1:8000
however this does not start the server.
Any help would be much appreciated.
Many thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论