Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable scrapydweb's first startup build configuration files #25

Closed
whg517 opened this issue Feb 22, 2019 · 1 comment
Closed

Disable scrapydweb's first startup build configuration files #25

whg517 opened this issue Feb 22, 2019 · 1 comment
Labels
designed so It's Not a Bug, It's a Feature

Comments

@whg517
Copy link

whg517 commented Feb 22, 2019

As scrapydweb commands are first launched with input,

>>> ScrapydWeb version: 1.1.0
>>> Use 'scrapydweb -h' to get help
>>> Main pid: 23712
>>> Loading default settings from d:\virtualenvs\foo--pw-wxg0\lib\site-packages\scrapydweb\default_settings.py

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
The config file 'scrapydweb_settings_v7.py' has been copied to current working directory.
Please add your SCRAPYD_SERVERS in the config file and restart scrapydweb.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

We've seen that scrapydweb loads the default configuration file, and that it can be launched completely. Why generate one in the current directory? I feel this is redundant and unfriendly, so if I switch directories (I'm in a virtual environment) and execute it again, it will still generate a configuration file.

I think now that you have the default configuration, you should use the default configuration. Custom configurations are specified using command-line parameters. Configuration file, of course, you can also use the parameter specifies --setting settings.conf.

If you command line configuration file specified every time very troublesome, can draw lessons from scrapyd configuration file loading way.

@my8100
Copy link
Owner

my8100 commented Feb 22, 2019

  1. The default_settings.py file inside the site-packages directory would be overridden if ScrapydWeb is reinstalled or updated. Therefore the customized configurations would be lost if they are stored in the default_settings.py file, which would be painful if you have added hundreds of Scrapyd servers.
  2. Also note that the content of the default_settings.py file would be updated in order to support new features along with a new release. That's why the name of the scrapydweb_settings_vN.py file comes with a version number.
  3. Actually, if the scrapydweb_settings_vN.py file is not found in the current directory, ScrapydWeb would search it in the parent directory until reaching the root directory. So I think it's easy to work around even in the case of virtual environment -- just move the scrapydweb_settings_vN.py file to your users home directory (or D:/ for your case).

@my8100 my8100 added the designed so It's Not a Bug, It's a Feature label Feb 22, 2019
@my8100 my8100 closed this as completed Feb 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
designed so It's Not a Bug, It's a Feature
Projects
None yet
Development

No branches or pull requests

2 participants