Re: how can I return javascript code in a view callable?
37 views
Skip to first unread message
Mengu
unread,
Jun 29, 2012, 6:35:21 AM6/29/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pylons-discuss
you return them like a string but change the content type.
On Jun 29, 8:54 am, no_computer <p...@avos.com> wrote:
> how can I return some javascript code or a javascript file with view
> callables in Pyramid/Pylon framework?
Robottaway
unread,
Jun 30, 2012, 10:41:53 AM6/30/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pylons-...@googlegroups.com
If you want to return a javascript file from disk best to use the static content view, which in your projects __init__.py would look something like this:
or if you need to generate a file on the fly and return it generate the file and then write it out using the correct headers, which is easy using FileResponse: