<type 'exceptions.AttributeError'>
Python 2.7.6: /usr/bin/python
Wed Dec 12 17:03:12 2018

A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.

 /usr/local/lib/python2.7/dist-packages/flup/server/fcgi_base.py in run(self=<flup.server.fcgi_base.Request object>)
    556         """Runs the handler, flushes the streams, and ends the request."""
    557         try:
=>  558             protocolStatus, appStatus = self.server.handler(self)
    559         except:
    560             traceback.print_exc(file=self.stderr)
protocolStatus undefined, appStatus undefined, self = <flup.server.fcgi_base.Request object>, self.server = <flup.server.fcgi.WSGIServer object>, self.server.handler = <bound method WSGIServer.handler of <flup.server.fcgi.WSGIServer object>>
 /usr/local/lib/python2.7/dist-packages/flup/server/fcgi_base.py in handler(self=<flup.server.fcgi.WSGIServer object>, req=<flup.server.fcgi_base.Request object>)
   1114         try:
   1115             try:
=> 1116                 result = self.application(environ, start_response)
   1117                 try:
   1118                     for data in result:
result = None, self = <flup.server.fcgi.WSGIServer object>, self.application = <Flask 'chili'>, environ = {'CONTENT_LENGTH': '', 'CONTENT_TYPE': '', 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'HTTP_ACCEPT_ENCODING': 'gzip', 'HTTP_CONNECTION': 'Keep-Alive', 'HTTP_HOST': 'zhangchi.de', 'HTTP_IF_MODIFIED_SINCE': 'Thu, 18 Oct 2018 23:56:04 GMT', 'HTTP_USER_AGENT': 'CCBot/2.0 (https://commoncrawl.org/faq/)', 'PATH_INFO': '/img/hongkong-street-oneyearinhk.jpg', 'QUERY_STRING': '', ...}, start_response = <function start_response>
 /usr/local/lib/python2.7/dist-packages/flask/app.py in __call__(self=<Flask 'chili'>, environ={'CONTENT_LENGTH': '', 'CONTENT_TYPE': '', 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'HTTP_ACCEPT_ENCODING': 'gzip', 'HTTP_CONNECTION': 'Keep-Alive', 'HTTP_HOST': 'zhangchi.de', 'HTTP_IF_MODIFIED_SINCE': 'Thu, 18 Oct 2018 23:56:04 GMT', 'HTTP_USER_AGENT': 'CCBot/2.0 (https://commoncrawl.org/faq/)', 'PATH_INFO': '/img/hongkong-street-oneyearinhk.jpg', 'QUERY_STRING': '', ...}, start_response=<function start_response>)
   1995     def __call__(self, environ, start_response):
   1996         """Shortcut for :attr:`wsgi_app`."""
=> 1997         return self.wsgi_app(environ, start_response)
   1998 
   1999     def __repr__(self):
self = <Flask 'chili'>, self.wsgi_app = <bound method Flask.wsgi_app of <Flask 'chili'>>, environ = {'CONTENT_LENGTH': '', 'CONTENT_TYPE': '', 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'HTTP_ACCEPT_ENCODING': 'gzip', 'HTTP_CONNECTION': 'Keep-Alive', 'HTTP_HOST': 'zhangchi.de', 'HTTP_IF_MODIFIED_SINCE': 'Thu, 18 Oct 2018 23:56:04 GMT', 'HTTP_USER_AGENT': 'CCBot/2.0 (https://commoncrawl.org/faq/)', 'PATH_INFO': '/img/hongkong-street-oneyearinhk.jpg', 'QUERY_STRING': '', ...}, start_response = <function start_response>
 /usr/local/lib/python2.7/dist-packages/flask/app.py in wsgi_app(self=<Flask 'chili'>, environ={'CONTENT_LENGTH': '', 'CONTENT_TYPE': '', 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'HTTP_ACCEPT_ENCODING': 'gzip', 'HTTP_CONNECTION': 'Keep-Alive', 'HTTP_HOST': 'zhangchi.de', 'HTTP_IF_MODIFIED_SINCE': 'Thu, 18 Oct 2018 23:56:04 GMT', 'HTTP_USER_AGENT': 'CCBot/2.0 (https://commoncrawl.org/faq/)', 'PATH_INFO': '/img/hongkong-street-oneyearinhk.jpg', 'QUERY_STRING': '', ...}, start_response=<function start_response>)
   1983             except Exception as e:
   1984                 error = e
=> 1985                 response = self.handle_exception(e)
   1986             except:
   1987                 error = sys.exc_info()[1]
response undefined, self = <Flask 'chili'>, self.handle_exception = <bound method Flask.handle_exception of <Flask 'chili'>>, e = AttributeError("'NoneType' object has no attribute 'split'",)
 /usr/local/lib/python2.7/dist-packages/flask/app.py in handle_exception(self=<Flask 'chili'>, e=AttributeError("'NoneType' object has no attribute 'split'",))
   1538             # otherwise, we just raise the error again
   1539             if exc_value is e:
=> 1540                 reraise(exc_type, exc_value, tb)
   1541             else:
   1542                 raise e
global reraise = <function reraise>, exc_type = <type 'exceptions.AttributeError'>, exc_value = AttributeError("'NoneType' object has no attribute 'split'",), tb = <traceback object>
 /usr/local/lib/python2.7/dist-packages/flask/app.py in wsgi_app(self=<Flask 'chili'>, environ={'CONTENT_LENGTH': '', 'CONTENT_TYPE': '', 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'HTTP_ACCEPT_ENCODING': 'gzip', 'HTTP_CONNECTION': 'Keep-Alive', 'HTTP_HOST': 'zhangchi.de', 'HTTP_IF_MODIFIED_SINCE': 'Thu, 18 Oct 2018 23:56:04 GMT', 'HTTP_USER_AGENT': 'CCBot/2.0 (https://commoncrawl.org/faq/)', 'PATH_INFO': '/img/hongkong-street-oneyearinhk.jpg', 'QUERY_STRING': '', ...}, start_response=<function start_response>)
   1980         try:
   1981             try:
=> 1982                 response = self.full_dispatch_request()
   1983             except Exception as e:
   1984                 error = e
response undefined, self = <Flask 'chili'>, self.full_dispatch_request = <bound method Flask.full_dispatch_request of <Flask 'chili'>>
 /usr/local/lib/python2.7/dist-packages/flask/app.py in full_dispatch_request(self=<Flask 'chili'>)
   1612                 rv = self.dispatch_request()
   1613         except Exception as e:
=> 1614             rv = self.handle_user_exception(e)
   1615         return self.finalize_request(rv)
   1616 
rv = None, self = <Flask 'chili'>, self.handle_user_exception = <bound method Flask.handle_user_exception of <Flask 'chili'>>, e = AttributeError("'NoneType' object has no attribute 'split'",)
 /usr/local/lib/python2.7/dist-packages/flask/app.py in handle_user_exception(self=<Flask 'chili'>, e=AttributeError("'NoneType' object has no attribute 'split'",))
   1515 
   1516         if handler is None:
=> 1517             reraise(exc_type, exc_value, tb)
   1518         return handler(e)
   1519 
global reraise = <function reraise>, exc_type = <type 'exceptions.AttributeError'>, exc_value = AttributeError("'NoneType' object has no attribute 'split'",), tb = <traceback object>
 /usr/local/lib/python2.7/dist-packages/flask/app.py in full_dispatch_request(self=<Flask 'chili'>)
   1610             rv = self.preprocess_request()
   1611             if rv is None:
=> 1612                 rv = self.dispatch_request()
   1613         except Exception as e:
   1614             rv = self.handle_user_exception(e)
rv = None, self = <Flask 'chili'>, self.dispatch_request = <bound method Flask.dispatch_request of <Flask 'chili'>>
 /usr/local/lib/python2.7/dist-packages/flask/app.py in dispatch_request(self=<Flask 'chili'>)
   1596             return self.make_default_options_response()
   1597         # otherwise dispatch to the handler for that endpoint
=> 1598         return self.view_functions[rule.endpoint](**req.view_args)
   1599 
   1600     def full_dispatch_request(self):
self = <Flask 'chili'>, self.view_functions = {'dropbox_auth_finish': <function dropbox_auth_finish>, 'dropbox_auth_start': <function dropbox_auth_start>, 'for_certbot': <function for_certbot>, 'home': <function home>, 'image': <function image>, 'logout': <function logout>, 'page': <function page>, 'post': <function post>, 'public': <function public>, 'regen_pages': <function regen_pages>, ...}, rule = <Rule '/img/<filename>' (HEAD, OPTIONS, GET) -> image>, rule.endpoint = 'image', req = <Request 'http://zhangchi.de/img/hongkong-street-oneyearinhk.jpg' [GET]>, req.view_args = {'filename': u'hongkong-street-oneyearinhk.jpg'}
 /var/zhangchide/chili.py in image(filename=u'hongkong-street-oneyearinhk.jpg')
     67 def image(filename):
     68     if not LOCAL_DEV:
=>   69         r = request.referrer.split('/')[2]
     70         if r != DOMAIN and r != DOMAIN2:
     71             abort(403)
r undefined, global request = <Request 'http://zhangchi.de/img/hongkong-street-oneyearinhk.jpg' [GET]>, request.referrer = None, request.referrer.split undefined

<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'split'
      args = ("'NoneType' object has no attribute 'split'",)
      message = "'NoneType' object has no attribute 'split'"