Just starting out, running an example app but getting an error.

23 views
Skip to first unread message

aaron

unread,
Dec 20, 2010, 3:45:00 PM12/20/10
to gae-sessions
Hi there,

I'm running a mac (OSX). When I get the Demo app plugged into the app
engine, and fire it out in a browser I get the following traceback
error:

Traceback (most recent call last):
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/tools/dev_appserver.py", line 3245, in _HandleRequest
self._Dispatch(dispatcher, self.rfile, outfile, env_dict)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/tools/dev_appserver.py", line 3186, in _Dispatch
base_env_dict=env_dict)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/tools/dev_appserver.py", line 531, in Dispatch
base_env_dict=base_env_dict)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/tools/dev_appserver.py", line 2410, in Dispatch
self._module_dict)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/tools/dev_appserver.py", line 2320, in ExecuteCGI
reset_modules = exec_script(handler_path, cgi_path, hook)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/tools/dev_appserver.py", line 2216, in
ExecuteOrImportScript
exec module_code in script_module.__dict__
File "/Users/aaron/Downloads/dound-gae-sessions-cbf1c79/demo-with-
google-logins/main.py", line 87, in <module>
if __name__ == '__main__': main()
File "/Users/aaron/Downloads/dound-gae-sessions-cbf1c79/demo-with-
google-logins/main.py", line 86, in main
def main(): run_wsgi_app(application)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/ext/webapp/util.py", line 97, in run_wsgi_app
run_bare_wsgi_app(add_wsgi_middleware(application))
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/ext/webapp/util.py", line 102, in add_wsgi_middleware
return _config_handle.add_wsgi_middleware(application)
File "/Users/aaron/Downloads/dound-gae-sessions-cbf1c79/demo-with-
google-logins/appengine_config.py", line 13, in
webapp_add_wsgi_middleware
app = SessionMiddleware(app, cookie_key=COOKIE_KEY)
File "/Users/aaron/Downloads/dound-gae-sessions-cbf1c79/demo/
gaesessions/__init__.py", line 436, in __init__
raise ValueError("RFC2104 recommends you use at least a 32
character key. Try os.urandom(64) to make a key.")
ValueError: RFC2104 recommends you use at least a 32 character key.
Try os.urandom(64) to make a key.

Any ideas on how to solve this?

Cheers,
Aaron

David Underhill

unread,
Dec 20, 2010, 4:07:37 PM12/20/10
to gae-se...@googlegroups.com
Aaron,

The demo code does not ship with a key for signing cookies to help prevent users from forgetting to change the key before using in a production environment.  To run the demo code, you need to provide a value for COOKIE_KEY (located in appengine_config.py).  I suggest you generate the key using os.urandom(64) in a python interpreter and then copying/pasting the value into appengine_config.py.

~ David
Reply all
Reply to author
Forward
0 new messages