-
Notifications
You must be signed in to change notification settings - Fork 0
/
redirect.py
26 lines (20 loc) · 997 Bytes
/
redirect.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
class Marketplace(webapp.RequestHandler):
def get(self):
self.response.set_status(301)
self.response.headers['Location'] = 'market://search?q=pname:hu.budapestcycletrack'
self.response.out.write('market://search?q=pname:hu.budapestcycletrack')
class Appstore(webapp.RequestHandler):
def get(self):
self.response.set_status(301)
self.response.headers['Location'] = 'http://itunes.apple.com/hu/app/budapest-cycle-tracker/id433400907?mt=8'
self.response.out.write('http://itunes.apple.com/hu/app/budapest-cycle-tracker/id433400907?mt=8')
application = webapp.WSGIApplication(
[('/marketplace', Marketplace),
('/appstore', Appstore)],
debug=True)
def main():
run_wsgi_app(application)
if __name__ == "__main__":
main()