From ecb4f44cbc27f65c9c44940f0904a014de825e0f Mon Sep 17 00:00:00 2001 From: Pablo Hoffman Date: Thu, 14 Apr 2011 12:36:09 -0300 Subject: [PATCH] Added clarification on how to work with local settings and scrapy deploy --- docs/topics/scrapyd.rst | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/docs/topics/scrapyd.rst b/docs/topics/scrapyd.rst index 6bfe8d3f7..b44b0b47b 100644 --- a/docs/topics/scrapyd.rst +++ b/docs/topics/scrapyd.rst @@ -330,6 +330,35 @@ This way, you can deploy your project just by using:: scrapy deploy +Local settings +-------------- + +Sometimes, while your working on your projects, you may want to override your +certain settings with certain local settings that shouldn't be deployed to +Scrapyd, but only used locally to develop and debug your spiders. + +One way to deal with this is to have a ``local_settings.py`` at the root of +your project (where the ``scrapy.cfg`` file resides) and add these lines to the +end of your project settings:: + + try: + from local_settings import * + except ImportError: + pass + +``scrapy deploy`` won't deploy anything outside the project module so the +``local_settings.py`` file won't be deployed. + +Here's the directory structure, to illustrate:: + + scrapy.cfg + local_settings.py + myproject/ + __init__.py + settings.py + spiders/ + ... + .. _topics-egg-caveats: Egg caveats