简体   繁体   中英

taskqueue is not working google app engine

 File "/layers/google.python.pip/pip/lib/python3.8/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "/layers/google.python.pip/pip/lib/python3.8/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/layers/google.python.pip/pip/lib/python3.8/site-packages/django/views/generic/base.py", line 103, in view
    return self.dispatch(request, *args, **kwargs)
  File "/layers/google.python.pip/pip/lib/python3.8/site-packages/django/views/generic/base.py", line 142, in dispatch
    return handler(request, *args, **kwargs)
  File "/workspace/apps/account/views.py", line 235, in post
    taskqueue.add(queue_name='create-waybill', url = reverse('_api:createWaybill') ,  params = {'key':url_key})

  File "/layers/google.python.pip/pip/lib/python3.8/site-packages/google/appengine/api/taskqueue/taskqueue.py", line 575, in create_rpc
    return apiproxy_stub_map.UserRPC('taskqueue', deadline, callback)
  File "/layers/google.python.pip/pip/lib/python3.8/site-packages/google/appengine/api/apiproxy_stub_map.py", line 444, in __init__
    self.__rpc = CreateRPC(service, stubmap)
  File "/layers/google.python.pip/pip/lib/python3.8/site-packages/google/appengine/api/apiproxy_stub_map.py", line 69, in CreateRPC
    assert stub, 'No api proxy found for service "%s"' % service
AssertionError: No api proxy found for service "taskqueue"

I am working on google app engine and try to run taskqueue and getting error

i am using django python3

from google.appengine.api import taskqueue

taskqueue.Task(name='create-waybill', url='/_api/createWaybill',params = {'key':url_key}).add()

just this one

and

path ('createWaybill', csrf_exempt(views.CreateWaybill.as_view()), name='createWaybill'),

To use the bundled services in Python 3, you first have to enable them. See documentation from Google for doing that

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM