1

我的开发团队中的其他人一直在通过 Fabric 将我们的 Django 应用程序部署到服务器。因为我也需要能够部署,所以我在我的系统上设置了 Fabric,但是当我尝试部署时,我得到一个全局名称错误:

File ".../fabfile.py", line 4, in staging
  config.settings = 'staging'
NameError: global name 'config' is not defined

由于我们知道 fabfile 很好,所以它一定是我的设置中的问题。有任何想法吗?

4

1 回答 1

7

ohhh i know this error , this error is happening because you have installed in your machine fabric version higher than 0.9 and the fabric file that you want to use has been developed using and old version of fabric < 0.9.

For more detail the config obj has been replaced with env in fabric 0.9 so if you run yor fabfile using fabric version higher than 0.9 it will not recognize the config object.

so you should install an old version of the fabric package or just update your fabfile i think it's time for that :)

Hope this can help you :)

于 2010-11-07T22:21:12.530 回答