我一直在进行GAE --尝试创建一个新项目:并在命令中出现错误。
abid@abid-webdev:~/Documents/GAE_projects$ python google_appengine/dev_appserver.py exe1.py/错误
默认情况:"GET / HTTP/1.1“500 - ERROR 2013-10-29 08:29:43,171 wsgi.py:262]回溯(最近一次调用):File module.py:608行239,在句柄处理程序= _config_handle.add_wsgi_middleware(self._LoadHandler())文件"/home/abid/Documents/GAE_projects/google_appengine/google/appengine/runtime/wsgi.py",行298中,在_LoadHandler处理程序中,路径,err = LoadObject(self._handler)文件"/home/abid/Documents/GAE_projects/google_appengine/google/appengine/runtime/wsgi.py",行84,在LoadObject obj = import(path) ImportError: No模块中名为helloworld信息2013-10-2908:29:43,191 module.py:608]缺省值:"GET / HTTP/1.1“500-Error 2013-10-2908:29:51,775 wsgi.py:262]回溯(最近一次调用):文件LoadObject第239行,在句柄处理程序= _config_handle.add_wsgi_middleware(self._LoadHandler())文件"/home/abid/Documents/GAE_projects/google_appengine/google/appengine/runtime/wsgi.py",行298中,在_LoadHandler处理程序中,路径中,err = LoadObject(self._handler)文件"/home/abid/Documents/GAE_projects/google_appengine/google/appengine/runtime/wsgi.py",行84中,在LoadObject obj =导入( path )ImportError中:没有名为helloworld的模块
1) ImportError: No module named helloworld ->我注意到了这个错误
exercise1,从以前的项目helloworld/复制app.yaml文件。应用程序:您的应用程序id版本:1运行时: python27 api_version: 1 threadsafe: true 处理程序:- url: /.* 脚本: helloworld.application>
2)在google URL ->上,对路径与正则表达式/.* (所有URL )匹配的URL的每个请求都应由helloworld模块中的应用程序对象处理。
3)我的目录结构
abid@abid-webdev:~/Documents/GAE_projects$ ls
exercise1
helloworld
google_appengine
问题:
如何修改我的app.yaml以与我的其他项目(例如exercise1 )一起工作?
谢谢大家的帮助。
发布于 2013-11-08 22:49:03
把这个从上面拿出来!
对于您的新项目,需要在目录:中使用以下结构
Directory: exercise1
File: app.yaml
File: exercise1.pyIn app.yaml您需要这样的东西:
application: your-app-id
version: 1
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /.*
script: exercise1.application"script: exportise1.application“行告诉它要使用哪个文件(在本例中是actiise1.py)和要使用的WSGI实例(在本例中是应用程序)。
在习题1.In中,您需要这样的内容::
import webapp2
class HomePage(webapp2.RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
self.response.write('Hey Y'all!')
application = webapp2.WSGIApplication([
('/', HomePage),
], debug=True)在这里,您可以看到我们在中提到的应用程序。
一旦有了这个基本结构,就需要启动dev appserver。您在问题中的做法是不正确的:
您需要使用目录“dev_appserver”来运行exercise1,而不是python文件。
假设仍然位于“~/Documents/GAE_projects/”中,那么从exercise1目录运行以下命令:
python ~/Documents/GAE_projects/google_appengine/dev_appserver.py ./这将启动dev_appserver.py脚本,告诉它使用当前目录(这就是"./“的意思)。
如果你跟着这个,你就应该站起来滚!
https://stackoverflow.com/questions/19728397
复制相似问题