title: python configuration at compile time
body: <p>As of now we have a file <code>conf.py</code> which stores most of our configuration variables for the service. We have code similar to this:</p>
  
  <pre><code>environment = 'dev' # could be dev, local, staging, production
  configa = 'something'
  configb = 'something else'
  
  if environment = 'dev':
      configa = 'something dev'
  
  elif environment = 'local':
      configa = 'something local'
  </code></pre>
  
  <p>Is this the right way to manage configuration file in a python project? Are these configuration loaded into variables at compile time (while creating pyc files), or are the if conditions checked every time the conf is imported in a python script or is it every time a configuration variable is accessed?</p>