The full path usually means the absolute path from the root directory, slash (/) in unix and C:\ in Windows. In the case of a project on my Ubuntu machine located at /srv/scrapy/dirbot (notice the leading slash, meaning the full path from the root), the config file might set `default = srv.scrapy.dirbot.settings`.
But this would imply that each directory is a Python module and the following files would be required:
/srv/__init__.py
/srv/scrapy/__init__.py
Not only that, the Python import search path would have to include the root directory ('/'), which most installations, by default, certainly do not. On my system it looks more like:
>>> sys.path
['/usr/lib/python2.7', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/pymodules/python2.7', '']
There is essentially no notion of absolute (full) path or relative path (no leading slash) in Python's module importing syntax. Only when Python goes to the operating system to access the file, does the concept of absolute/relative path get involved. Python just walks the PYTHONPATH and imports the first module it finds matching the names you give.
Assuming our current working directory is /srv/scrapy, and using the following directory structure from the Scrapy documentation sample project:
/srv/scrapy/
├── dirbot
│ ├── __init__.py
│ ├── items.py
│ ├── pipelines.py
│ ├── settings.py
│ └── spiders
│ ├── dmoz.py
│ ├── googledir.py
│ └── __init__.py
├── README.rst
└── scrapy.cfg
Let's look at the config file:
scrapy.cfg
[settings]
default = dirbot.settings
Using the PYTHONPATH above, importing is attempted in this order:
/usr/lib/python2.7/dirbot/settings.py
/usr/local/lib/python2.7/dist-packages/dirbot/settings.py
/usr/lib/python2.7/dist-packages/dirbot/settings.py
/usr/lib/pymodules/python2.7/dirbot/settings.py
dirbot/settings.py
Using the given import expression `dirbot.settings` the first four absolute paths are searched and may fail to find a module. The fifth path is actually a relative path which is where our settings file is located. Note: based on our current working directory, the relative path dirbot/settings.py in our case maps to the absolute path /srv/scrapy/dirbot/settings.py.
If your project does not have a scrapy.cfg file or your scrapyd service is not started from inside a project then you can set the environment variable SCRAPY_SETTINGS_MODULE using the same Python syntax (e.g. dirbot.settings). Instead of using a long string for this variable simulating an absolute path and adding __init__.py files in all directories down to the root, we instead can use our regular dirbot.settings setting which is the module location from our project directory and then add the project directory to another environment variable PYTHONPATH which gets added to the module search list.
On unix we set environment variables with a shell like so:
export SCRAPY_SETTINGS_MODULE=dirbot.settings
export PYTHONPATH=/srv/scrapy