Ejemplo n.º 1
0
 def post(self):
     project_name = request.form['project_name']
     project = Project()
     project.project_name = project_name
     db.session.add(project)
     db.session.commit()
     return project.to_dict()
Ejemplo n.º 2
0
def project_create():
    project_name = request.form['project_name']
    project = Project()
    project.project_name = project_name
    db.session.add(project)
    db.session.commit()
    return redirect("/project/%s/spider/deploy" % project.id, code=302)
Ejemplo n.º 3
0
 def get_project_list(self):
     data = request("get",
                    self._scrapyd_url() + "/listprojects.json",
                    return_type="json")
     result = []
     if data:
         for project_name in data['projects']:
             project = Project()
             project.project_name = project_name
             result.append(project)
     return result