I'm migrating my gae app to python 2.7. This is my new app.yaml:
application: webfaze
version: main
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /mapreduce(/.*)?
script: mapreduce/main.application
- url: /(.*\.(html|css|js|gif|jpg|png|ico|swf))
static_files: static/\1
upload: static/.*
expiration: "1d"
- url: .*
script: main.application
- url: /task/.*
script: main.application
login: admin
But I get this error message:
Error parsing yaml file:
Invalid object:
threadsafe cannot be enabled with CGI handler: mapreduce/main.application
in "webfaze/app.yaml", line 22, column 1
Can you tell me how to resolve the error?
Checking the source code, it looks that you need to define your handlers' path without any slash:
if (handler.script and (handler.script.endswith('.py') or
'/' in handler.script)):
raise appinfo_errors.ThreadsafeWithCgiHandler(
'threadsafe cannot be enabled with CGI handler: %s' %
handler.script)
Move application.py
to the root of your project and modify the handler's path accordingly.
Change:
- url: /mapreduce(/.*)?
script: mapreduce/main.application
To:
- url: /mapreduce(/.*)?
script: mapreduce.main.application
You may also need to add an __init__.py to the 'mapreduce' folder if one doesn't exist there already. That will make the python interpret the folder as a module.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With