Skip to content

Instantly share code, notes, and snippets.

@sagoyanfisic
Created March 16, 2018 17:38
Show Gist options
  • Save sagoyanfisic/64176cbf2dbff168f13652f7590215ca to your computer and use it in GitHub Desktop.
Save sagoyanfisic/64176cbf2dbff168f13652f7590215ca to your computer and use it in GitHub Desktop.
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /static
static_dir: static
- url: /.*
script: main.app
libraries:
- name: webapp2
version: "2.5.2"
import webapp2
from google.appengine.ext.webapp import template
import os
class MainPage(webapp2.RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
self.response.out.write('Hello, webapp World!')
class PrincipalPage(webapp2.RequestHandler):
def get(self):
template_values = dict()
path = os.path.join(os.path.dirname(__file__), 'templates', 'index.html')
self.response.out.write(template.render(path, template_values))
app = webapp2.WSGIApplication([
('/', MainPage),
('/template', PrincipalPage),
], debug=False)
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>Hola HTML</title>
</head>
<body>
<p>Hola Mundo!</p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment