This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tornado.web | |
class NoCacheStaticFileHandler(tornado.web.StaticFileHandler): | |
def set_extra_headers(self, path): | |
self.set_header("Cache-control", "no-cache") | |
class Application(tornado.web.Application): | |
def __init__(self): | |
handlers = [ | |
# ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import urllib | |
from tornado.web import RequestHandler | |
#CAS setting | |
CAS_SETTINGS = { | |
#replace this with your cas server url | |
'cas_server' : 'http://cas_server', | |
#replace this with your website url | |
'service_url' : 'http://service_url/deal_with_st', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a hack to patch slow socket.getfqdn calls that | |
# BaseHTTPServer (and its subclasses) make. | |
# See: http://bugs.python.org/issue6085 | |
# See: http://www.answermysearches.com/xmlrpc-server-slow-in-python-how-to-fix/2140/ | |
import BaseHTTPServer | |
def _bare_address_string(self): | |
host, port = self.client_address[:2] | |
return str(host) |