On 11 Ago, 14:26, Daniel Roseman <
roseman.dan...@googlemail.com>
wrote:
> You haven't shown us the code of the view that's creating the file, so
> we can't say what's wrong with it.
You're right. Here's the relevant code snippet in views.py:
#...
tempfile = NamedTemporaryFile()
tempfile.file.write(content)
response['tempfile'] = tempfile.name.split('/')[-1]
tempfile.file.close()
#....
variables = RequestContext(request, response)
return render_to_response('my_template.html', variables)
>
> However I wonder why you need to create a file at all. Why not just
> serve a normal view in the iframe, just as you do everywhere else?
> There's nothing special about the content of an iframe from the point
> of view of the server, so Django is just as capable as serving it up
> dynamically as any other page.
It seems a better approach. I'll try this and see if it fits my needs.
Thank you.
Alex
> --
> DR.