title: Where to put a configuration file in Python?
body: <p>In development mode, I have the following directory tree :</p>
  
  <pre><code>| my_project/
  | setup.py
  | my_project/
      | __init__.py
      | main.py
      | conf/
          | myproject.conf
  </code></pre>
  
  <p>I use <a href="http://docs.python.org/library/configparser.html" rel="noreferrer">ConfigParser</a> to parse the <code>myproject.conf</code> file.</p>
  
  <p>In my code, it's easy to load the file with a good path : <code>my_project/conf/myproject.conf</code></p>
  
  <p>The problem is : When I install my project using the setup.py, the configuration file are situated (thanks to setup.py) in the <code>/etc/my_project/myproject.conf</code> and my application in the <code>/usr/lib/python&lt;version&gt;/site-packages/my_project/</code>.</p>
  
  <p>How can I refer my <code>my_project/conf/myproject.conf</code> file in my project in "production" mode, and refer to the local file (<code>my_project/conf/myproject.conf</code>) in "devel" mode.</p>
  
  <p>In addition, I would like to be portable if possible (Work on windows for example).</p>
  
  <p>What's the good practice to do that ?</p>