请教一个django后台管理页面问题

mirage_o 2011-12-28 11:38:32
刚学习django,在配置了django admin后访问页面一直出现css无效的问题,
而且每次访问admin的相关页面都会报出一些问题
[27/Dec/2011 23:30:13] "GET / HTTP/1.1" 404 1981
[27/Dec/2011 23:30:13] "GET / HTTP/1.1" 404 1981
[27/Dec/2011 23:30:18] "GET /admin HTTP/1.1" 301 0
[27/Dec/2011 23:30:18] "GET /admin/ HTTP/1.1" 200 2028
Traceback (most recent call last):
File "D:\Python27\lib\site-packages\django\core\servers\basehttp.py", line 283, in run
self.result = application(self.environ, self.start_response)
File "D:\Python27\lib\site-packages\django\contrib\staticfiles\handlers.py", line 69, in __call__
return super(StaticFilesHandler, self).__call__(environ, start_response)
File "D:\Python27\lib\site-packages\django\core\handlers\wsgi.py", line 272, in __call__
response = self.get_response(request)
File "D:\Python27\lib\site-packages\django\contrib\staticfiles\handlers.py", line 59, in get_response
return self.serve(request)
File "D:\Python27\lib\site-packages\django\contrib\staticfiles\handlers.py", line 52, in serve
return serve(request, self.file_path(request.path), insecure=True)
File "D:\Python27\lib\site-packages\django\contrib\staticfiles\views.py", line 39, in serve
return static.serve(request, path, document_root=document_root, **kwargs)
File "D:\Python27\lib\site-packages\django\views\static.py", line 54, in serve
mimetype, encoding = mimetypes.guess_type(fullpath)
File "D:\Python27\lib\mimetypes.py", line 294, in guess_type
init()
File "D:\Python27\lib\mimetypes.py", line 355, in init
db.read_windows_registry()
File "D:\Python27\lib\mimetypes.py", line 259, in read_windows_registry
for ctype in enum_types(mimedb):
File "D:\Python27\lib\mimetypes.py", line 249, in enum_types
ctype = ctype.encode(default_encoding) # omit in 3.x!
File "D:\Python27\lib\encodings\utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xca in position 0: invalid continuation byte
Traceback (most recent call last):
File "D:\Python27\lib\site-packages\django\core\servers\basehttp.py", line 283, in run
self.result = application(self.environ, self.start_response)
File "D:\Python27\lib\site-packages\django\contrib\staticfiles\handlers.py", line 69, in __call__
return super(StaticFilesHandler, self).__call__(environ, start_response)
File "D:\Python27\lib\site-packages\django\core\handlers\wsgi.py", line 272, in __call__
response = self.get_response(request)
File "D:\Python27\lib\site-packages\django\contrib\staticfiles\handlers.py", line 59, in get_response
return self.serve(request)
File "D:\Python27\lib\site-packages\django\contrib\staticfiles\handlers.py", line 52, in serve
return serve(request, self.file_path(request.path), insecure=True)
File "D:\Python27\lib\site-packages\django\contrib\staticfiles\views.py", line 39, in serve
return static.serve(request, path, document_root=document_root, **kwargs)
File "D:\Python27\lib\site-packages\django\views\static.py", line 54, in serve
mimetype, encoding = mimetypes.guess_type(fullpath)
File "D:\Python27\lib\mimetypes.py", line 294, in guess_type
init()
File "D:\Python27\lib\mimetypes.py", line 355, in init
db.read_windows_registry()
File "D:\Python27\lib\mimetypes.py", line 259, in read_windows_registry
for ctype in enum_types(mimedb):
File "D:\Python27\lib\mimetypes.py", line 249, in enum_types
ctype = ctype.encode(default_encoding) # omit in 3.x!
File "D:\Python27\lib\encodings\utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xca in position 0: invalid continuation byte

初步确定是编码的问题, 但不知道如何修改。。。
...全文
268 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
mirage_o 2011-12-29
  • 打赏
  • 举报
回复
应该没有,我把代码拷贝到其他电脑上边(xp 32)上就没有这个问题, 是不是python django在windows7 64位上边支持不好?
livesguan 2011-12-29
  • 打赏
  • 举报
回复
你看一下,返回的的信息里,是不是有GBK的.

37,720

社区成员

发帖
与我相关
我的任务
社区描述
JavaScript,VBScript,AngleScript,ActionScript,Shell,Perl,Ruby,Lua,Tcl,Scala,MaxScript 等脚本语言交流。
社区管理员
  • 脚本语言(Perl/Python)社区
  • IT.BOB
加入社区
  • 近7日
  • 近30日
  • 至今

试试用AI创作助手写篇文章吧