Justin Venezuela avatar Justin Venezuela committed fec0bc6

Clearing out crap from old tournament site. Prints hello world.

Comments (0)

Files changed (13)

 application: mit-starleague
-version: 2
+version: 3
 runtime: python
 api_version: 1
 
 handlers:
 
-- url: /favicon.ico
-  static_files: src/static/img/favicon.ico
-  upload: src/static/img
-
-- url: /css/starleague.css
-  static_files: src/static/css/starleague.css
-  upload: src/static/css
-
-- url: /img/background.png
-  static_files: src/static/img/background.png
-  upload: src/static/img
-
-- url: /img/terran.png
-  static_files: src/static/img/terran.png
-  upload: src/static/img
-
-- url: /img/protoss.png
-  static_files: src/static/img/protoss.png
-  upload: src/static/img
-
-- url: /img/zerg.png
-  static_files: src/static/img/zerg.png
-  upload: src/static/img
-
-- url: /img/justintv.png
-  static_files: src/static/img/justintv.png
-  upload: src/static/img
-
 - url: /.*
-  script: src/handlers.py
+  script: src/handlers.py
-import os
-from google.appengine.ext import webapp
+"""
+Request router for MIT Starleague tournament site.
+"""
+
+__author__ = 'Justin Venezuela (jven@mit.edu), Max Nelson (maxnelso@mit.edu)'
+
+from google.appengine.ext.webapp import RequestHandler
 from google.appengine.ext.webapp import template
+from google.appengine.ext.webapp import WSGIApplication
 from google.appengine.ext.webapp.util import run_wsgi_app
 
-def getTemplate(template_name, params={}):
-  templates_path = os.path.join(os.path.dirname(__file__), 'templates')
-  template_file = os.path.join(templates_path, template_name)
-  return template.render(template_file, params)
+class HelloWorldHandler(RequestHandler):
+  def get(self):
+    return self.response.out.write('Hello, world!')
 
-class HomeHandler(webapp.RequestHandler):
-  def get(self):
-    return self.response.out.write(getTemplate('index.html'), )
-
-class SponsorshipHandler(webapp.RequestHandler):
-  def get(self):
-    return self.response.out.write(getTemplate('sponsorship.html'))
-
-application = webapp.WSGIApplication([
-  ('/', HomeHandler),
-  ('/sponsorship', SponsorshipHandler)
-], debug=True)
-
-def main():
-  run_wsgi_app(application)
+application = WSGIApplication([
+    ('/.*', HelloWorldHandler)], debug=True)
 
 if __name__ == '__main__':
-  main()
+  run_wsgi_app(application)

src/static/css/starleague.css

-/**
- * Author: Justin Venezuela (jven@mit.com)
- * Stylesheet for MIT Starleague tournament site.
- */
-
-@import url(http://fonts.googleapis.com/css?family=Aldrich);
-
-/**
- * HTML Tags
- */
-
-body{
-  background:url(/img/background.png);
-  font-family:'Aldrich', sans-serif;
-  font-size:1.2em;
-  text-align:center;
-  color:white
-}
-a:link,
-a:hover,
-a:visited,
-a:active{
-  color:white
-}
-
-/**
- * Defined classes.
- */
-
-.column{
-  width:600px;
-  margin:40px auto;
-}
-.content{
-  padding:15px;
-  border-style:solid;
-  border-color:black;
-  border-width:5px;
-  background-color:#8B7D6B
-}
-.small_link{
-  font-size:0.7em
-}
-.footer{
-  font-size:0.8em
-}
-.heading{
-  font-size:1.4em;
-  font-weight:bold
-}

src/static/html/index.html

-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-
-<!--
-  - Author: Justin Venezuela (jven@mit.edu)
-  - Web site for MIT Starleague Invitational 2011.
-  -->
-
-<html>
-  <head>
-    <link href="/css/starleague.css" rel="stylesheet" type="text/css" />
-    <title>MIT Starleague</title>
-  </head>
-  <body>
-    <div class="column">
-      <div class="content">
-        <p>
-          <img src="/img/protoss.png" />
-          <img src="/img/terran.png" />
-          <img src="/img/zerg.png" />
-        </p>
-        <p class="heading">MIT Starleague Invitationals 2011</p>
-        </table>
-        <p>When: Saturday, October 29, 2011</p>
-        <p>Where: ???</p>
-        <hr>
-        <p class="heading">Sponsors</p>
-        <p>
-          <a href="http://justin.tv/" target="_blank"><img src="/img/justintv.png" /></a>
-        </p>
-      </div>
-      <div class="footer">
-        <p>Questions? Comments? E-mail starleague-officers (at) mit (dot) edu.</p>
-      </div>
-    </div>
-  </body>
-</html>
Add a comment to this file

src/static/img/background.png

Removed
Old image
Add a comment to this file

src/static/img/favicon.ico

Removed
Old image
Add a comment to this file

src/static/img/justintv.png

Removed
Old image
Add a comment to this file

src/static/img/protoss.png

Removed
Old image
Add a comment to this file

src/static/img/terran.png

Removed
Old image
Add a comment to this file

src/static/img/zerg.png

Removed
Old image

src/templates/base.html

-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-
-<!--
-  - Author: Justin Venezuela (jven@mit.edu)
-  - Web site for MIT Starleague Invitational 2011.
-  -->
-
-<html>
-  <head>
-    <link href="/css/starleague.css" rel="stylesheet" type="text/css" />
-    <title>MIT Starleague</title>
-  </head>
-  <body>
-    <div class="column">
-      <div class="content">
-{% block content %}
-{% endblock %}
-      </div>
-      <div class="footer">
-        <p>Questions? Comments? E-mail starleague-officers (at) mit (dot) edu.</p>
-      </div>
-    </div>
-  </body>
-</html>

src/templates/index.html

-{% extends "base.html" %}
-{% block content %}
-<div id="tourney_info">
-  <p>
-    <img src="/img/protoss.png" />
-    <img src="/img/terran.png" />
-    <img src="/img/zerg.png" />
-  </p>
-  <p class="heading">MIT Starleague Invitationals 2011</p>
-  </table>
-  <p>When: Saturday, October 29, 2011</p>
-  <p>Where: ???</p>
-</div>
-<hr>
-<div id="sponsor_info">
-  <p class="heading">Sponsors</p>
-  <p>
-    <a href="http://justin.tv/" target="_blank"><img src="/img/justintv.png" /></a>
-  </p>
-  <p class="small_link"><a href="/sponsorship">Interested in sponsoring?</a></p>
-</div>
-{% endblock %}

src/templates/sponsorship.html

-{% extends "base.html" %}
-{% block content %}
-<div id="about_us">
-  <p>We're so awesome!</p>
-  <p class="small_link"><a href="/">Back</a></p>
-</div>
-{% endblock %}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.