Setting the content type in Pylons 0.9.6
I'm trying to render some Atom feeds with Pylons - I've got a genshi template that more or less renders the atom feed, but I need to return it as application/atom+xml For the life of me I can't figure out how the new global response object works - setting content_type has no effect.. my controller looks something like: response.content_type = application/atom+xml response.content = render(genshi-xml, atom-feed) (I had to write my own 'genshi-xml' engine plugin wrapper for Genshi, because Genshi's default requires the file extension to be .html, but that's a whole other story...) Alec --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com 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 -~--~~~~--~~--~--~---
Re: Setting the content type in Pylons 0.9.6
Hi Alec, You need: response.headers['Content-type'] = application/atom+xml return render(genshi-xml, atom-feed) James alecf wrote: I'm trying to render some Atom feeds with Pylons - I've got a genshi template that more or less renders the atom feed, but I need to return it as application/atom+xml For the life of me I can't figure out how the new global response object works - setting content_type has no effect.. my controller looks something like: response.content_type = application/atom+xml response.content = render(genshi-xml, atom-feed) (I had to write my own 'genshi-xml' engine plugin wrapper for Genshi, because Genshi's default requires the file extension to be .html, but that's a whole other story...) Alec --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com 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 -~--~~~~--~~--~--~---
Re: Setting the content type in Pylons 0.9.6
I think the only disappointing thing with that is the charset normally gets stuck in there too, and I want to set that in another location... I played around with it and I also was able to set config['pylons.response_options']['content_type'] for a similar effect. Is this going a little too much behind-the scenes? Alec On Sep 26, 3:40 pm, James Gardner [EMAIL PROTECTED] wrote: Hi Alec, You need: response.headers['Content-type'] = application/atom+xml return render(genshi-xml, atom-feed) James alecf wrote: I'm trying to render some Atom feeds with Pylons - I've got a genshi template that more or less renders the atom feed, but I need to return it as application/atom+xml For the life of me I can't figure out how the new global response object works - setting content_type has no effect.. my controller looks something like: response.content_type = application/atom+xml response.content = render(genshi-xml, atom-feed) (I had to write my own 'genshi-xml' engine plugin wrapper for Genshi, because Genshi's default requires the file extension to be .html, but that's a whole other story...) Alec --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com 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 -~--~~~~--~~--~--~---