Source

Mango / decorators.py

Full commit
from mango import utf8

def baseurl():
    def _(): pass
    _.cache = None
    def baseurl(view=None):
        if view is None:
            return _.cache
        def wrapper(request, *args, **kwargs):
            if _.cache is None:
                _.cache = utf8(request.build_absolute_uri('/'))
            return view(request, *args, **kwargs)
        return wrapper
    return baseurl
baseurl = baseurl()