'Indicates whether the current request is in "debug" mode'

@property
def debug(self):

    debug = ('debug' in self.httprequest.args)
    if (debug and (self.httprequest.args.get('debug') == 'assets')):
        debug = 'assets'
    if (not debug):
        debug = self.httprequest.environ.get('HTTP_X_DEBUG_MODE')
    if ((not debug) and self.httprequest.referrer):
        debug = bool(urlparse.parse_qs(urlparse.urlparse(self.httprequest.referrer).query, keep_blank_values=True).get('debug'))
    return debug
