同步面料与韩国
问题描述:
当我尝试执行与南部schemamigration
用下面的代码:同步面料与韩国
# coding=utf-8
from fabric.api import env, hosts, local, run, cd
def updatebd():
local('cd /Users/gian88/Sites/www/py/WEB/web/web/ && python manage.py schemamigration principal –-auto')
当执行织物下面的错误说:
Migration names should contain only alphanumeric characters and underscores.
当使用句子with cd
中,命令本地无法识别句子with cd
中的网址并说出以下错误:
can't open file 'manage.py': [Errno 2] No such file or directory
答
的问题的解决方案是使用命令LCD,句子是这样的:
def updatebd():
with lcd('/Users/gian88/Sites/www/py/WEB/web/web/'):
local('python manage.py schemamigration principal --auto')
您是否尝试过使用'与cd',而不是''&&? ([docs](http://docs.fabfile.org/en/latest/api/core/context_managers.html)) – alecxe 2013-04-25 17:54:27
当与cd一起使用句子时,命令local无法识别cd中的句子中的url,并说出现以下错误:无法打开'manage.py'文件:[Errno 2]没有这样的文件或目录 – 2013-04-25 18:40:27
您能编辑您的问题,并且包括您如何尝试使用'with cd'以及您有什么错误得到? – alecxe 2013-04-25 18:48:38