Hi I need to process a remote .ical file from another server on my own server and hand it back to the requesting user.
So what I need to do is:
- Fetch the file (could do this with urllib2)
- Process the file with some regex (not the question)
- hand it back with a specific header <– my main problem
I’d know how to do this with php:
header('Content-type: text/calendar; charset=utf-8');
header('Content-Disposition: inline; filename=calendar.ics');
echo $ical;
exit;
But how to do the same thing in python?
Well, as with anything web-related, you start with a WSGI application.
Then to deploy, you use a handler, e.g. plain CGI would be
See http://www.wsgi.org/ for more materials about WSGI.