本文介绍了django.core.servers.basehttp.FileWrapper在Django 1.9中消失了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从Django 1.8迁移到1.9。并且出现以下错误:

I am migrating from django 1.8 to 1.9. and I got the following error:

我按如下方式导入它:

from django.core.servers.basehttp import FileWrapper

在django 1.9发行说明中搜索此名称没有结果。什么是 FileWrapper 的替代品?

Searching this name in django 1.9 release notes gives no result. What is the replacement for FileWrapper ?

推荐答案

Django刚有一个包装器从wsgiref.util导入FileWrapper

Django just had a wrapper to the wsgiref module you can just get it directly

from wsgiref.util import FileWrapper

这篇关于django.core.servers.basehttp.FileWrapper在Django 1.9中消失了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 11:38