Applied Will Norri's patch to the appengine project template so that OAuth now works on localhost
diff --git a/samples/new_project_template/main.py b/samples/new_project_template/main.py
index 7238344..a04dd01 100755
--- a/samples/new_project_template/main.py
+++ b/samples/new_project_template/main.py
@@ -37,11 +37,6 @@
APP_ID = os.environ['APPLICATION_ID']
-if 'Development' in os.environ['SERVER_SOFTWARE']:
- STEP2_URI = 'http://localhost:8080/auth_return'
-else:
- STEP2_URI = 'http://%s.appspot.com/auth_return' % APP_ID
-
class Credentials(db.Model):
credentials = OAuthCredentialsProperty()
@@ -79,7 +74,8 @@
scope='https://www.googleapis.com/auth/buzz',
xoauth_displayname='App Name')
- authorize_url = flow.step1_get_authorize_url(STEP2_URI)
+ callback = self.request.relative_url('/auth_return')
+ authorize_url = flow.step1_get_authorize_url(callback)
memcache.set(user.user_id(), pickle.dumps(flow))
request_handler.redirect(authorize_url)