I'm reposting this conversation for others to benefit. Sorry, something
got broken with my mail client.
---
W dniu 09.07.2011 21:08, Krishnakant Mane pisze:
On 09/07/11 18:57, Karol Tomala wrote:
W dniu 08.07.2011 20:14, Krishnakant Mane pisze:
Hi Karol.
So after setting this headers and other response attributes,what
should be the end?
Should it be a json return?
Or should I justt render the return or what is the last thing my
controller action is supposed to do?
Happy hacking.
Krishnakant.
No. You should just open the file you want to send and return the
file contents.
So Could you give me an example?
Do you mean I must use f = open("file.ods","r")
data = f.read()
return data
Is this what I must do after setting response headers, mime type etc?
happy hacking.
Krishnakant.
Yes that's exactly what I meant.
Of course doing it properly, you might want to write some WSGI
middleware that would handle static files, but in order to do this you
should read PEP document about WSGI and get yourself familiar with it.
Writing your own middleware can be complicated topic and therefore you
have to know how things work. I would suggest reading WSGI and Pylons
documentation - it's really helpful and almost obligatory if you want to
write decent code with Pylons.
Regards,
Karol Tomala
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en.