这是css中的代码
background-image: url( {{ url_for('static', filename = 'background.jpg') }} ) ;
静态的路径是“/ Users / gengruijie / Desktop /未命名文件夹/ OneDrive /学习/ cs /课外/ Github / AutoGrading / sample”。所以它会给我一个错误:
Traceback (most recent call last):
File "/Users/gengruijie/anaconda/lib/python2.7/site-packages/flask/app.py", line 2000, in __call__
return self.wsgi_app(environ, start_response)
File "/Users/gengruijie/anaconda/lib/python2.7/site-packages/flask/app.py", line 1991, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/Users/gengruijie/anaconda/lib/python2.7/site-packages/flask/app.py", line 1567, in handle_exception
reraise(exc_type, exc_value, tb)
File "/Users/gengruijie/anaconda/lib/python2.7/site-packages/flask/app.py", line 1988, in wsgi_app
response = self.full_dispatch_request()
File "/Users/gengruijie/anaconda/lib/python2.7/site-packages/flask/app.py", line 1641, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/Users/gengruijie/anaconda/lib/python2.7/site-packages/flask/app.py", line 1544, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/Users/gengruijie/anaconda/lib/python2.7/site-packages/flask/app.py", line 1639, in full_dispatch_request
rv = self.dispatch_request()
File "/Users/gengruijie/anaconda/lib/python2.7/site-packages/flask/app.py", line 1625, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/Users/gengruijie/anaconda/lib/python2.7/site-packages/flask/helpers.py", line 892, in send_static_file
cache_timeout=cache_timeout)
File "/Users/gengruijie/anaconda/lib/python2.7/site-packages/flask/helpers.py", line 633, in send_from_directory
filename = safe_join(directory, filename)
File "/Users/gengruijie/anaconda/lib/python2.7/site-packages/flask/helpers.py", line 603, in safe_join
return os.path.join(directory, filename)
File "/Users/gengruijie/anaconda/lib/python2.7/posixpath.py", line 73, in join
path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 26: ordinal not in range(128)
我的Python版本是2.7.12 我的烧瓶版本是'0.11.1'