scrapydweb
scrapydweb copied to clipboard
[Bug Report] Setting doesn't take effect in scrapydweb_settings_v10.py
Describe the bug
I set the DATA_PATH value in scrapydweb_settings_v10.py but it doesn't take effect.
- There's no files created under the
DATA_PATH - It could be consolidated on the Web page "Settings"
To Reproduce Steps to reproduce the behavior:
- Make and cd an empty directory
- Run
scrapydwebonce to generate ascrapydweb_settings_v10.pyfile - Open
scrapydweb_settings_v10.pyand setDATA_PATH. - Run
scrapydwebagain and the service starts normally.
It's weird that the SCRAPYD_SERVERS I added did appear in the webpage, but the DATA_PATH didn't reflect the value i set.
Seems related to the vars.py about import_module
SCRAPYDWEB_SETTINGS_PY = 'scrapydweb_settings_v10.py'
try:
custom_settings_module = importlib.import_module(os.path.splitext(SCRAPYDWEB_SETTINGS_PY)[0])
except ImportError:
custom_data_path = ''
custom_database_url = ''
else:
custom_data_path = getattr(custom_settings_module, 'DATA_PATH', '')
custom_data_path = custom_data_path if isinstance(custom_data_path, str) else ''
custom_database_url = getattr(custom_settings_module, 'DATABASE_URL', '')
custom_database_url = custom_database_url if isinstance(custom_database_url, str) else ''
Environment (please complete the following information):
- Operating system: Ubuntu 16.04
- Python version: 3.7.3
- ScrapydWeb version: 1.4.0
- Scrapyd version: 1.2.1
- Scrapyd amount 2
- Scrapy version: 2.2.1
- Browser Chrome 70
Temporary solution: set DATA_PATH as an environment variable by export on *nix.