Ejemplo n.º 1
0
def get_site(key_name=None):
    key_name = os.environ.get('HTTP_HOST')
    site = site_cache.get(key_name, None)
    if site: return site
    site = Eventsite.all().get()
    site_cache[key_name] = site
    #register(os.environ.get('HTTP_HOST'))
    return site
Ejemplo n.º 2
0
def get_site(key_name=None):
	key_name = os.environ.get('HTTP_HOST')
	site=site_cache.get(key_name, None)
	if site: return site
	site=Eventsite.all().get()
	site_cache[key_name]=site
	#register(os.environ.get('HTTP_HOST'))
	return site
Ejemplo n.º 3
0
def start_schedule_newsletters(request):
    try:
        for ns in namespace_registry.all():
            set_namespace(ns.ns)
            for site in Eventsite.all().filter('offline =', False):
                taskqueue.add(url='/subscriptions/schedule_next_newsletter/',
                              params={'site': str(site.key())})
    except Exception, e:
        logging.error("%s in \n%s" %
                      (traceback.format_exc(), str(request.POST)))
Ejemplo n.º 4
0
def start_schedule_newsletters(request):
    try:
        for ns in namespace_registry.all():
            set_namespace(ns.ns)
            for site in Eventsite.all().filter('offline =', False):
                taskqueue.add(url='/subscriptions/schedule_next_newsletter/',
                       params={'site': str(site.key())}
                      )
    except Exception,e:
          logging.error("%s in \n%s"% (traceback.format_exc(),str(request.POST)))