6
votes

i'm trying to follow this explanation: https://developers.google.com/appengine/docs/python/tools/uploadingdata#Downloading_and_Uploading_All_Data

but when i add to my app.yaml:

- url: /remote_api
  script: $PYTHON_LIB/google/appengine/ext/remote_api/handler.py
  login: admin

and trying to update my app, i'm getting:

Error parsing yaml file: Invalid object: threadsafe cannot be enabled with CGI handler: $PYTHON_LIB/google/appengine/ext/remote_api/handler.py

Error.

What am i doing wrong?

Thanks!

BTW, this is my app.yaml:

application: XXXX-my-application-name
version: 1
runtime: python27
api_version: 1
threadsafe: true

handlers:
- url: /static
  static_dir: static

- url: /remote_api
  script: $PYTHON_LIB/google/appengine/ext/remote_api/handler.py
  login: admin

- url: /favicon.ico
  static_files: static/favicon.ico
  upload: static/favicon.ico

- url: /.*
  script: main.app  # a WSGI application in the main module's global scope

libraries:
- name: django
  version: "1.3"
2

2 Answers

13
votes

Try something like

- url: /remote_api
  script: google.appengine.ext.remote_api.handler.application
  login: admin

Which would use the WSGI application instead of the main() method CGI style.

5
votes

Unless you are doing something VERY special you should not change the remote url.

just put the following in the app.yaml:

builtins:
- remote_api: on