def decorator(func): subdomains = [(None, '')] if app.config.get('DEFAULT_SUBDOMAIN'): subdomains.append((app.config.get('DEFAULT_SUBDOMAIN'), '_default')) if app.config.get('SECURE_SUBDOMAIN'): if secure == 'both': subdomains.append((app.config.get('SECURE_SUBDOMAIN'), '_secure')) elif secure: subdomains = [(app.config.get('SECURE_SUBDOMAIN'), '')] for subdomain, suffix in subdomains: name = func.func_name + suffix app.add_url_rule(url, name, cache_for(cache_age, cache_private)(render(template)(func)), methods=methods, subdomain=subdomain) return func
def decorator(func): return expose(url, methods)(secure_view(secure)(cache_for(cache_age, cache_private)(ajax(func))))