diff --git a/scrapyd/website.py b/scrapyd/website.py index 61075f3a9..2e6203b84 100644 --- a/scrapyd/website.py +++ b/scrapyd/website.py @@ -14,7 +14,7 @@ class Root(resource.Resource): self.eggrunner = config.get('egg_runner') logsdir = config.get('logs_dir') self.app = app - self.putChild('', Home()) + self.putChild('', Home(self)) self.putChild('schedule.json', webservice.Schedule(self)) self.putChild('addversion.json', webservice.AddVersion(self)) self.putChild('listprojects.json', webservice.ListProjects(self)) @@ -50,20 +50,38 @@ class Root(resource.Resource): class Home(resource.Resource): + def __init__(self, root): + resource.Resource.__init__(self) + self.root = root + def render_GET(self, txrequest): + vars = { + 'projects': ', '.join(self.root.scheduler.list_projects()), + } return """
Available projects: %(projects)s
+ +To schedule a spider you need to use the API (this web UI is only for +monitoring)
+ +Example using curl:
+curl http://localhost:6800/schedule.json -d project=default -d spider=somespider
For more information about the API, see the Scrapyd documentation
-""" +""" % vars class ProcessMonitor(resource.Resource):