# -*- encoding: utf-8 -*- import cgi import json import time import hashlib import functools from itsdangerous import SignatureExpired, BadSignature from werkzeug.http import dump_cookie from werkzeug.routing import Rule from werkzeug.wrappers import Response from werkzeug.exceptions import BadRequest, Forbidden, NotFound from isso.compat import text_type as str from isso import utils, local from isso.utils import http, parse, markdown from isso.utils.crypto import pbkdf2 from isso.views import requires def md5(text): return hashlib.md5(text.encode('utf-8')).hexdigest() class JSON(Response): def __init__(self, *args): return super(JSON, self).__init__(*args, content_type='application/json') def xhr(func): """A decorator to check for CSRF on POST/PUT/DELETE using a