Skip to content

Instantly share code, notes, and snippets.

@northface
Created January 6, 2013 03:31
Show Gist options
  • Save northface/4465043 to your computer and use it in GitHub Desktop.
Save northface/4465043 to your computer and use it in GitHub Desktop.
import wsgiref.handlers
from google.appengine.ext import webapp
import os
from google.appengine.ext.webapp import template
class MainHandler(webapp.RequestHandler):
def get(self):
fpath =os.path.join(os.path.dirname(__file__),'views','index.html')
html = template.render(fpath, None)
self.response.out.write(html)
def main():
application = webapp.WSGIApplication([('/', MainHandler)],debug=True)
wsgiref.handlers.CGIHandler().run(application)
if __name__ == '__main__':
main()
application: XXXXXXXX
version: 1
runtime: python
api_version: 1
handlers:
- url: /css
static_dir: css</pre>
<pre class="brush: bush;">- url: /images
static_dir: views/images
- url: .*
script: main.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment