【发布时间】:2011-10-24 15:12:02
【问题描述】:
我开始将 Fabric 用于 Django 生产服务器。
这是我的fabfile.py
from fabric.api import *
env.hosts = ['me@myserver.net']
def srefresh():
with path('~me/myproject'):
run('python manage.py collectstatic')
sudo('apachectl restart')
这是输出
$ fab 刷新
[me@myserver.net] 执行任务'srefresh'
[me@myserver.net] 运行:python manage.py collectstatic
[me@myserver.net] 输出:python:无法打开文件'manage.py':[Errno 2] 没有这样的文件或目录
我做错了什么?
(不确定我是否很好地使用了with 上下文管理器)
【问题讨论】:
标签: python django production-environment fabric