It can redirect a failure with simplest way I know
try:
#stuff
except:
self.redirect('http://www.example.com/testfile.ext')
return
Or this slightly more complicated redirect one can modify from 301 to 302
def redirect_from_appspot(wsgi_app):
def redirect_if_needed(env, start_response):
if env["HTTP_HOST"].startswith('my_app_name.appspot.com'):
import webob, urlparse
request = webob.Request(env)
scheme, netloc, path, query, fragment = urlparse.urlsplit(request.url)
url = urlparse.urlunsplit([scheme, 'www.my_domain.com', path, query, fragment])
start_response('301 Moved Permanently', [('Location', url)])
return ["301 Moved Peramanently",
"Click Here" % url]
else:
return wsgi_app(env, start_response)
return redirect_if_needed
Case depends if 500 Error is your app or google server. Easiest would be featuring it in gae console we can request app engine team to enable, or yaml or most formal with regex. The easy way is try, except and redirect.