App Engineでタスクを実行しようとしていますが、次のエラーが発生します。
ERROR 2012-07-24 18:47:01,030 wsgi.py:189]
Traceback (most recent call last):
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 187, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 225, in _LoadHandler
handler = __import__(path[0])
ImportError: No module named tasks
INFO 2012-07-24 18:47:01,040 dev_appserver.py:2952] "POST /tasks HTTP/1.1" 500 -
WARNING 2012-07-24 18:47:01,045 taskqueue_stub.py:1934] Task task22 failed to execute. This task will retry in 0.100 seconds
タスクを追加するためにこれを行っています:
import os
import webapp2
from google.appengine.ext.webapp import blobstore_handlers
from controllers.basehandler import BaseHandler
from google.appengine.ext import blobstore
from google.appengine.api import taskqueue
from google.appengine.ext.webapp.util import run_wsgi_app
class UploadHandler(blobstore_handlers.BlobstoreUploadHandler, BaseHandler):
def post(self):
upload_files = self.get_uploads('video_file')
blob_info = upload_files[0]
current_user = self.current_user
if current_user:
if current_user.video_file_bob:
old_video = current_user.video_file_bob.key()
blobstore.delete(old_video)
current_user.video_file_bob = blob_info.key()
current_user.put()
params = {'user':current_user}
taskqueue.add(url='/tasks')
self.redirect('/video_upload')
app = webapp2.WSGIApplication([('/store_video', UploadHandler)],
debug=True)
これはタスクのコードです:
import re
import urlparse
import webapp2
from google.appengine.ext import blobstore
from controllers.basehandler import BaseHandler
import gdata.youtube.service
from google.appengine.api import taskqueue
from google.appengine.ext.webapp.util import run_wsgi_app
import logging
class YoutubeUpload(BaseHandler):
def post(self):
logging.info('Here')
app = webapp2.WSGIApplication([('/tasks', YoutubeUpload)],
debug=True)
これを解決する方法について何かアイデアはありますか?
編集
私のapp.yalmのコンテンツ:
application: traapp
version: 1
runtime: python27
api_version: 1
threadsafe: True
handlers:
- url: /images
static_dir: assets/images
- url: /link_submit
script: controllers.video_link_submit.app
- url: /video_upload
script: controllers.video_upload.app
- url: /store_video
script: controllers.video_upload_handler.app
- url: /tasks
script: tasks.youtube_upload.app
login: admin
- url: /.*
script: controllers.login.app
libraries:
- name: PIL
version: latest
builtins:
- appstats: on