def export(request):
    response = Response(content_type='application/csv')
with NamedTemporaryFile(prefix='XML_Export_%s' % datetime.now(), suffix=
    '.xml', delete=True) as f:
    response.app_iter = f
response.headers['Content-Disposition'] = 'attachment; filename=Export.xml'
return response
How can I serve temporary files from Python Pyramid