I'm building a site and attempting to do everything I used to do in PHP in Python (what can I say, I just like it better!). There are a couple of scenarios that I don't quite understand, however. Such as:
1. If my plain ol' Python page is called from an Ajax function and returns some json, how do I control the headers that are sent back? In PHP I used the header() function where I don't see an obvious equivalent in Python.
2. If I want to provide a download for a user and I want it to live outside th webroot for security purposes, how do I read that binary file and put it out to the output buffer? In PHP it was the fpassthru() function.
Thanks everyone, I really appreciate your help!