title: How do I get root dir of python wsgi app within an imported module?
body: <p>Nginx with WSGI is loading a file in my root directory called <code>run.py</code></p>
  
  <p>Within <code>run.py</code> I get the root directory with</p>
  
  <p><code>ROOT = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))</code></p>
  
  <p>This works fine.</p>
  
  <p>I now want to access this root variable within an imported module.
  I hear that globals are evil. But it seems odd to pass the root path into the modules that I'd like to use. What is the most pythonic way to work with this?</p>
  
  <p>Also - the reason why I want the root path is because I'm doing this within an imported module.</p>
  
  <p><code>os.chdir('/some/path')</code></p>
  
  <p>and I'd like to change back to the root path later in the script.</p>
  
  <p><code>os.chdir(ROOT)</code></p>
  
  <p>Thanks...</p>