Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

django.core.servers.basehttp.FileWrapper disappears in Django 1.9

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

ImportError: cannot import name 'FileWrapper'

I import it as follow:

from django.core.servers.basehttp import FileWrapper

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

like image 784
albar Avatar asked Mar 05 '16 17:03

albar


1 Answers

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

from wsgiref.util import FileWrapper
like image 82
Sayse Avatar answered Nov 04 '22 12:11

Sayse