blob: a1c7c07d1e27e6cc3a9e1f89835f1f20730f2b6f [file] [log] [blame]
The Android Open Source Project52d4c302009-03-03 19:29:09 -08001#!/usr/bin/python2.5
2#
3# Copyright (C) 2008 The Android Open Source Project
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#
17
18"""Serve static pages for the pdk on appengine
19"""
20
21import os
22
23from google.appengine.ext import webapp
24from google.appengine.ext.webapp.util import run_wsgi_app
25
26
27class MainPage(webapp.RequestHandler):
28 def get(self):
Mike Ritteraa2d9522009-04-29 09:19:32 -070029 self.redirect('online-pdk/guide/index.html')
The Android Open Source Project52d4c302009-03-03 19:29:09 -080030
Mike Ritterdfa54942009-04-01 17:30:12 -070031application = webapp.WSGIApplication([('/', MainPage)], debug=True)
The Android Open Source Project52d4c302009-03-03 19:29:09 -080032
33def main():
34 run_wsgi_app(application)
35
36if __name__ == "__main__":
37 main()
38
Mike Ritterdfa54942009-04-01 17:30:12 -070039# Testing
40# You must install google appengine. See: http://code.google.com/appengine/downloads.html
41#
42# Here's the command to run the pdk-docs server locally:
43# python <path_to_appengine_installation>/dev_appserver.py --address 0.0.0.0 \
44# <path_to_cupcake_code>/android/out/target/common/docs
45
46# To verify it is working you can access it with a browser loacally on port 8080:
47
48# http://localhost:8080/index.html
49
50
The Android Open Source Project52d4c302009-03-03 19:29:09 -080051# To upload this application:
52# /home/build/static/projects/apphosting/devtools/appcfg.py update pdk/
53# where the pdk directory contains: pdk.py, app.yaml, and the docs directory.
54# where the docs are made from the Pdk.mk file.