Zhang Jiuzhou
Zhang Jiuzhou

Reputation: 777

Scrapy: how to deploy more than one projects?

My scrapy.cfg is:

[settings]
default = project1.settings

[deploy:project1]
url = http://localhost:7000/
project = project1
version = dev

[deploy:project2]
url = http://localhost:7000/
project = project2
version = dev

And my directory structure is:

projects

--project1

----spiders

--project2

----spiders

--scrapy.cfg

How to modify the [settings] section to deploy project2?

Upvotes: 0

Views: 473

Answers (1)

kev
kev

Reputation: 161864

If you have 2 projects (project1 and project2):

[settings]
default = project1.settings
project2 = project2.settings

Pass the SCRAPY_PROJECT environment variable to scrapy command:

$ SCRAPY_PROJECT=project2 scrapy deploy project2

Note: make sure that root directory is clean (remove setup.py, build, etc) before running it.

Upvotes: 1

Related Questions