Skip to content

Commit ecb4f44

Browse files
committed
Added clarification on how to work with local settings and scrapy deploy
1 parent 36431a1 commit ecb4f44

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

docs/topics/scrapyd.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,35 @@ This way, you can deploy your project just by using::
330330

331331
scrapy deploy
332332

333+
Local settings
334+
--------------
335+
336+
Sometimes, while your working on your projects, you may want to override your
337+
certain settings with certain local settings that shouldn't be deployed to
338+
Scrapyd, but only used locally to develop and debug your spiders.
339+
340+
One way to deal with this is to have a ``local_settings.py`` at the root of
341+
your project (where the ``scrapy.cfg`` file resides) and add these lines to the
342+
end of your project settings::
343+
344+
try:
345+
from local_settings import *
346+
except ImportError:
347+
pass
348+
349+
``scrapy deploy`` won't deploy anything outside the project module so the
350+
``local_settings.py`` file won't be deployed.
351+
352+
Here's the directory structure, to illustrate::
353+
354+
scrapy.cfg
355+
local_settings.py
356+
myproject/
357+
__init__.py
358+
settings.py
359+
spiders/
360+
...
361+
333362
.. _topics-egg-caveats:
334363

335364
Egg caveats

0 commit comments

Comments
 (0)