Hi Everyone,
I am a newbie and trying to get a hang of GAE. I am trying to do a simple
'Hello World' example using GAE but keep getting an error. I have two files in
the helloworld folder, helloworld.py and app.yaml with the following code:
import webapp2
class MainPage(webapp2.RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
self.response.out.write('Hello, webapp World!')
app = webapp2.WSGIApplication([('/', MainPage)],
debug=True)
application: helloworld
version: 1
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /.*
script: helloworld.app
But when I launch the app from GAE launcher, http://localhost:8080/ does not
load. I get the following message in the log:
SyntaxError: invalid syntax
INFO 2012-08-10 05:41:31,773 dev_appserver.py:2952] "GET / HTTP/1.1" 500 -
ERROR 2012-08-10 05:41:31,996 wsgi.py:189]
Traceback (most recent call last):
File "C:\Program Files
(x86)\Google\google_appengine\google\appengine\runtime\wsgi.py", line 187, in
Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
File "C:\Program Files
(x86)\Google\google_appengine\google\appengine\runtime\wsgi.py", line 225, in
_LoadHandler
handler = __import__(path[0])
File "C:\Program Files
(x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py",
line 676, in Decorate
return func(self, *args, **kwargs)
File "C:\Program Files
(x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py",
line 1858, in load_module
return self.FindAndLoadModule(submodule, fullname, search_path)
File "C:\Program Files
(x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py",
line 676, in Decorate
return func(self, *args, **kwargs)
File "C:\Program Files
(x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py",
line 1722, in FindAndLoadModule
description)
File "C:\Program Files
(x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py",
line 676, in Decorate
return func(self, *args, **kwargs)
File "C:\Program Files
(x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py",
line 1665, in LoadModuleRestricted
description)
File "C:\Users\anandg112\Desktop\helloworld\helloworld\helloworld.py", line 1
Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)]
on win32
^
SyntaxError: invalid syntax
INFO 2012-08-10 05:41:32,017 dev_appserver.py:2952] "GET /favicon.ico
HTTP/1.1" 500 -
Can someone please help and let me know what I am doing wrong?
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-appengine/-/yhL2eN_JBkIJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.