By default Scrapy uses scrapy.cfg in the projects root. Is there a way to t开发者_如何学Pythonell it to use a different .cfg file?
No this is the default behavior.See this source.
As v01d said there's no way to explicitly tell scrapy to use a scrapy.cfg wherever you want it to be in the directory tree but if you look at the implementation of closest_scrapy_cfg - https://github.com/scrapy/scrapy/blob/master/scrapy/utils/conf.py#L24 - you can move scrapy.cfg up any level to root and it will find it.
So for example, if your default scrapy.cfg is:
/home/whatever/scrapy-projects/abc/scrapy.cfg
you can move it up one or more level.
Not sure where's the advantage though.
精彩评论