我的scrapy.cfg是:
[settings]
default = project1.settings
[deploy:project1]
url = http://localhost:7000/
project = project1
version = dev
[deploy:project2]
url = http://localhost:7000/
project = project2
version = dev
我的目录结构是:
项目
- PROJECT1
----蜘蛛
- 项目2
----蜘蛛
- scrapy.cfg
如何修改[settings]部分以部署project2?
答案 0 :(得分:1)
如果您有2个项目(project1和project2):
[settings]
default = project1.settings
project2 = project2.settings
将SCRAPY_PROJECT
环境变量传递给scrapy
命令:
$ SCRAPY_PROJECT=project2 scrapy deploy project2
注意:在运行之前,请确保根目录是干净的(删除setup.py
,build
等)。