url_map Map Rule static file endpoint static build_only True def expos

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
url_map = Map([Rule('/static/<file>', endpoint='static', build_only=True)])
def expose(rule, **kw):
def decorate(f):
kw['endpoint'] = f.__name__
url_map.add(Rule(rule, **kw))
return f
return decorate
def url_for(endpoint, _external=False, **values):
return local.url_adapter.build(endpoint, values, force_external=_external)
jinja_env.globals['url_for'] = url_for