google app engine app.yaml url handlers

2020-06-22 00:02发布

Im trying google app engine with python27.

How do I place my script in a different folder instead of placing under same folder with the app.yaml?

handlers:
- url: /.*
  script: code/helloworld.app  ##### this give error #####

error message "ImportError: Import by filename is not supported."

2条回答
爷的心禁止访问
2楼-- · 2020-06-22 00:56

If you're using Python 2.7 with multithreading, you need to reference by package name - code.helloworld.app.

查看更多
爱情/是我丢掉的垃圾
3楼-- · 2020-06-22 00:58

As Nick Johnson said: Make sure you reference by package name (code.helloworld.app). Also, make sure you have an empty code/__init__.py file.

查看更多
登录 后发表回答