Created
March 16, 2018 17:38
-
-
Save sagoyanfisic/64176cbf2dbff168f13652f7590215ca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
runtime: python27 | |
api_version: 1 | |
threadsafe: true | |
handlers: | |
- url: /static | |
static_dir: static | |
- url: /.* | |
script: main.app | |
libraries: | |
- name: webapp2 | |
version: "2.5.2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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