我只是从google app engine开始,我遵循了googleappengine上的基本hello world示例。
https://developers.google.com/appengine/docs/python/gettingstartedpython27/helloworld
在helloworld文件夹中创建了两个文件。
我不想使用GUI,我更喜欢使用mac终端来处理这个应用程序。我想通过终端在本地主机local host:80上启动这个应用程序。
在本地运行我的基本helloworld应用程序
$dev_appserver.py地狱世界。但我知道这个错误。
Traceback (most recent call last):
File "/usr/local/bin/dev_appserver.py", line 184, in <module>
_run_file(__file__, globals())
File "/usr/local/bin/dev_appserver.py", line 180, in _run_file
execfile(script_path, globals_)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 727, in <module>
main()
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 720, in main
dev_server.start(options)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 554, in start
options.yaml_files)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/application_configuration.py", line 556, in __init__
module_configuration = ModuleConfiguration(yaml_path)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/application_configuration.py", line 82, in __init__
self._yaml_path)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/application_configuration.py", line 271, in _parse_configuration
with open(configuration_path) as f:
IOError: [Errno 2] No such file or directory: 'helloworld'
我在helloworld目录中有两个文件。 应用程序yaml
application: your-app-id
version: 1
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /.*
script: helloworld.application
还有地狱世界
import webapp2
class MainPage(webapp2.RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
self.response.write('Hello, World!')
application = webapp2.WSGIApplication([
('/', MainPage),
], debug=True)
我也有同样的问题。经过一番努力,在
google_appengine
目录中而不是在helloword
目录中对我有效的命令是:python dev_appserver.py helloworld/
也许这会有帮助。
当您第一次启动Google App Engine时,会出现一个提示,询问您是否要创建“Command Symlinks”--确保单击OK,然后输入管理员密码。这使您能够使用/usr/local/bin文件夹中的符号链接来执行命令
dev_appserver.py
。在终端中输入以下内容(命令行)
这是我的浏览器、终端和查找窗口的外观。
作为参考,here是在mac上安装/运行google app engine的O'Reilly指南。
在安装了google cloud sdk之后,您是否运行了
从组织的角度来说,文件有点荒谬。我刚开始的时候完全错过了
相关问题 更多 >
编程相关推荐