我在我的 MacBookPro 上运行https://github.com/tianyu0915/pythoner.net/来学习 django。
按照阅读我所说的完成后,当我运行应用程序时,控制台说:
回溯(最近一次通话最后):
运行中的文件“/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/wsgiref/handlers.py”,第 85 行
self.result = application(self.environ, self.start_response)
文件“/Users/keviswang/.virtualenvs/pythoner/lib/python2.7/site-packages/django/contrib/staticfiles/handlers.py”,第 67 行,在 __call__
返回 self.application(environ, start_response)
__call__ 中的文件“/Users/keviswang/.virtualenvs/pythoner/lib/python2.7/site-packages/django/core/handlers/wsgi.py”,第 241 行
response = self.get_response(request)
文件“/Users/keviswang/.virtualenvs/pythoner/lib/python2.7/site-packages/django/core/handlers/base.py”,第 179 行,在 get_response
response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
文件“/Users/keviswang/.virtualenvs/pythoner/lib/python2.7/site-packages/django/core/handlers/base.py”,第 228 行,在 handle_uncaught_exception
返回回调(请求,**param_dict)
_wrapped_view 中的文件“/Users/keviswang/.virtualenvs/pythoner/lib/python2.7/site-packages/django/utils/decorators.py”,第 91 行
response = view_func(request, *args, **kwargs)
文件“/Users/keviswang/.virtualenvs/pythoner/lib/python2.7/site-packages/django/views/defaults.py”,第 32 行,在 server_error
t = loader.get_template(template_name) # 你需要创建一个 500.html 模板。
文件“/Users/keviswang/.virtualenvs/pythoner/lib/python2.7/site-packages/django/template/loader.py”,第 145 行,在 get_template
模板,起源 = find_template(template_name)
文件“/Users/keviswang/.virtualenvs/pythoner/lib/python2.7/site-packages/django/template/loader.py”,第 134 行,在 find_template
源,display_name = loader(名称,目录)
文件“/Users/keviswang/.virtualenvs/pythoner/lib/python2.7/site-packages/django/template/loader.py”,第 42 行,在 __call__
return self.load_template(template_name, template_dirs)
文件“/Users/keviswang/.virtualenvs/pythoner/lib/python2.7/site-packages/django/template/loader.py”,第 45 行,在 load_template
源,显示名称 = self.load_template_source(模板名称,模板目录)
文件“/Users/keviswang/.virtualenvs/pythoner/lib/python2.7/site-packages/django/template/loaders/filesystem.py”,第 39 行,在 load_template_source
返回 (file.read().decode(settings.FILE_CHARSET), 文件路径)
文件“/Users/keviswang/.virtualenvs/pythoner/lib/python2.7/encodings/utf_8.py”,第 16 行,解码
返回 codecs.utf_8_decode(输入,错误,真)
UnicodeDecodeError:“utf8”编解码器无法解码位置 98 中的字节 0xb4:无效的起始字节