无法在Google App Engine中排队任务队列

时间:2015-11-08 19:06:25

标签: python google-app-engine

使用以下代码在Google应用引擎中排队任务。但我无法排队。

html = urllib2.urlopen("http://google.com").read()
message = mail.EmailMessage(sender = "New Scrapper <temp@gmail.com>",
                                subject = "Sent from google app Engine")
message.to = "my_email@gmail.com"
message.body = "Thanks for visiting our website"

class MainPage(webapp2.RequestHandler):
        def get(self):
                self.response.write("in home page")

class google(webapp2.RequestHandler):
        def get(self):
                self.response.write("In google  class")
                message.send()
class queue(webapp2.RequestHandler):
        def get(self):
                self.response.write("In queue class.")
                taskqueue.add(url='/google')
                self.redirect('/')

app = webapp2.WSGIApplication([('/',MainPage),('/google',google),('/queue',queue)], debug = True)

0 个答案:

没有答案