Permalink
Browse files

Python 2.7 and FOR LEASE sign

  • Loading branch information...
1 parent 70ef84b commit ec926b89c401beb0db86718c3a80d48027cd18c6 @dustball dustball committed Apr 24, 2013
View
@@ -1,6 +1,7 @@
application: hd-website
version: 2
-runtime: python
+runtime: python27
+threadsafe: true
api_version: 1
handlers:
@@ -14,4 +15,4 @@ handlers:
static_dir: static
expiration: "1d"
- url: .*
- script: main.py
+ script: main.app
View
26 main.py
@@ -3,12 +3,8 @@
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
-from google.appengine.dist import use_library
-use_library('django', '1.2')
-
import pytz
from datetime import datetime
-from django.utils import simplejson
from google.appengine.api import memcache
from google.appengine.api import urlfetch
from google.appengine.ext import webapp
@@ -17,6 +13,7 @@
import pprint
import urllib
import re
+import json
PB_WIKI = 'dojowebsite'
PB_API_URL = 'http://%s.pbworks.com/api_v2/op/GetPage/page/%s'
@@ -37,11 +34,11 @@ def _request(url, cache_ttl=3600, force=False):
try:
data = urlfetch.fetch(url)
if 'pbworks.com' in url:
- resp = simplejson.loads(data.content[11:-3])
+ resp = json.loads(data.content[11:-3])
if "html" in resp:
resp["html"] = re.sub("/w/page/\d*", "", resp["html"])
else:
- resp = simplejson.loads(data.content)
+ resp = json.loads(data.content)
memcache.set(request_cache_key, resp, cache_ttl)
memcache.set(failure_cache_key, resp, cache_ttl*10)
except (ValueError, urlfetch.DownloadError), e:
@@ -118,14 +115,9 @@ def get(self, pagename, site = PB_WIKI):
self.error(404)
-def main():
- application = webapp.WSGIApplication([
- ('/api/pbwebhook', PBWebHookHandler),
- ('/api/event_staff', StaffHandler),
- ('/', IndexHandler),
- ('/(.+)', MainHandler)],
- debug=True)
- util.run_wsgi_app(application)
-
-if __name__ == '__main__':
- main()
+app = webapp.WSGIApplication([
+ ('/api/pbwebhook', PBWebHookHandler),
+ ('/api/event_staff', StaffHandler),
+ ('/', IndexHandler),
+ ('/(.+)', MainHandler)],
+ debug=True)
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -16,7 +16,8 @@
{% block content %}
<section class="hero-image" >
- <a href="/ANewHomeForHackerDojo" style="position:absolute; right:-105px; top:-50px; z-index:200"><img width="281" height="279" alt="Help save the Dojo! Donate now" src="{{cdn}}/static/images/omgmoved.png" border="0"></a>
+ <a href="/SpacesForLease" style="position:absolute; right:-105px; top:0px; z-index:200"><img width="297" height="228" alt="Spaces for Lease" src="{{cdn}}/static/images/forelease1.png" onmouseover="this.src='{{cdn}}/static/images/forelease2.png';" onmouseout="this.src='{{cdn}}/static/images/forelease1.png';" border="0"></a>
+
<div id="mycarousel" style="overflow:hidden">
<ul style="overflow:none">
<li>
@@ -116,3 +117,4 @@ <h3>Visit Us</h3>
</article>
{% endblock %}
+

0 comments on commit ec926b8

Please sign in to comment.