Streaming/iterable HttpResponse instances are kind of an issue which
needs sorting out. I've had problems in the past with the current
implementation. Maybe a closer look is actually necessary.

Regards,
Zack

On Oct 1, 3:41 am, David Cramer <[EMAIL PROTECTED]> wrote:
> Thanks Graham, I'll check that out.
>
> I was going to file a ticket for this, but it seems streaming isn't
> really "supported" anyways, so I had to change the approach.
>
> On Sep 30, 8:19 pm, Graham Dumpleton <[EMAIL PROTECTED]>
> wrote:
>
> > On Oct 1, 11:06 am, David Cramer <[EMAIL PROTECTED]> wrote:
>
> > > I'm running into an issue when trying to pass a file-like object to
> > > HttpResponse and telling it to label it as "application/xml"
>
> > > def sitemap(request, sitemaps, section):
> > >     page = request.GET.get('p', 1)
> > >     fpath = os.path.join(settings.BASE_PATH + '/', 'cache/sitemap-%s-
> > > %s.xml' % (section, page))
> > >     if not os.path.exists(fpath):
> > >         raise Http404
>
> > >     return HttpResponse(open(fpath, 'r'), mimetype='application/xml')
>
> > > When added the mimetype, nothing gets sent to the browser. Removing it
> > > solves the issue, but then it has an invalid content type.
>
> > Nothing to do with your specific problem, but knowing how you always
> > want things to run as well as possible and how big your sitemap file
> > apparently is, may interest you to look at wsgi.file_wrapper
> > references in:
>
> >  http://code.djangoproject.com/wiki/Version1.1Features
>
> > One of the tickets (7894) has patch to allow static files to be
> > returned using more optimal means provided by mod_wsgi/mod_python,
> > ie., using sendfile() or other memory mapping techniques.
>
> > Graham
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to