Example #1
0
import helipad

main, application = helipad.root('yourapp').static('static/templates/home.html')

if __name__ == '__main__':
    main()

Example #2
0
import helipad

main, application = helipad.root("yourapp").static(
    "/about/", {"": "static/templates/about.html", "company/": "static/templates/about_company.html"}
)

if __name__ == "__main__":
    main()
Example #3
0
from PerformanceEngine import time_util

from tweethit.utils.parser_util import date_to_str_tuple
from tweethit.utils.task_util import prevent_transient_error
from tweethit.model import Store, DAILY, WEEKLY, MONTHLY
from tweethit.query import get_renderer_query_for_frequency

from config import DEBUG_MODE, TEMPLATE_PRODUCT_COUNT
import secret
import logging

import datetime
from collections import defaultdict

helipad.root('tweethit').template_root('static/templates/')

if DEBUG_MODE:
    root_url = 'http://localhost:8000'
else:
    root_url = 'http://www.tweethit.com'


def create_day_href(locale, date, day_delta, root):
    date += datetime.timedelta(days=day_delta)
    year, month, day = date_to_str_tuple(date)
    return root + '/' + locale + '/day/' + year + '/' + month + '/' + day + '/'


def create_week_href(locale, date, week_delta, root):
    date += datetime.timedelta(weeks=week_delta)
Example #4
0
import helipad

helipad.root('yourapp').template_root('static/templates/')

class TemplateHandler(helipad.Handler):
  def get(self):
    return self.template('template.html', {
      'person': self.request.get('person') or "Nobody!",
    })

main, application = helipad.app(TemplateHandler)

if __name__ == '__main__':
  main()
Example #5
0
import helipad
import logging
import pythonloader
from PerformanceEngine import pdb
from tweethit.model import *
from google.appengine.api import memcache

QUERY_STRING = "SELECT __key__ FROM "

helipad.root('tweethit').template_root('static/templates/')

class DeleteHandler(helipad.Handler):
  def get(self,model_name):
    if model_name == 'memcache':
        if memcache.flush_all():
            self.response.out.write('MEMCACHE FLUSHED')
            
    elif model_name == 'template':
        pythonloader.mydata = {}
        self.response.out.write('LOCAL TEMPLATE CACHE FLUSHED')
        
    else:
        query = db.GqlQuery(QUERY_STRING+model_name)  
        keys = []
        for key in query:
            keys.append(key)
        pdb.delete(keys)
        self.response.out.write("Deleted all models of kind: %s" % model_name)
            
class DeleteKeyHandler(helipad.Handler):
  def get(self,model_name,key_name):