title: Python's working directory when running with WSGI and Apache
body: <p>I have a web application that, among other things, will query a database and create an Excel spreadsheet with the data.  I need to save the spreadsheet to the server's disk before sending the file to the client machine.  I'm using the Flask framework and openpyxl to generate the spreadsheet.  Everything works fine when running on Flask's dev server, but the real server is Apache2 with WSGI.  When I run it there, a "Permission Denied" error is raised when it tries to save the spreadsheet.  I don't know what Python's working directory is when running in Apache/WSGI.  </p>
  
  <p>Is there a way, maybe in the WSGI config file, to change the working directory, or somehow control where it will save to?  If possible, I'd like to use relative paths for saving (it makes the code more portable) which is why changing the working directory is the best solution.</p>