title: Python: How to import all methods and attributes from a module dynamically
body: <p>I'd like to load a module dynamically, given its string name (from an environment variable). I'm using Python 2.7. I know I can do something like:</p>
  
  <pre><code>import os, importlib
  my_module = importlib.import_module(os.environ.get('SETTINGS_MODULE'))
  </code></pre>
  
  <p>This is roughly equivalent to</p>
  
  <pre><code>import my_settings
  </code></pre>
  
  <p>(where <code>SETTINGS_MODULE = 'my_settings'</code>). The problem is, I need something equivalent to</p>
  
  <pre><code>from my_settings import *
  </code></pre>
  
  <p>since I'd like to be able to access all methods and variables in the module. I've tried</p>
  
  <pre><code>import os, importlib
  my_module = importlib.import_module(os.environ.get('SETTINGS_MODULE'))
  from my_module import *
  </code></pre>
  
  <p>but I get a bunch of errors doing that. Is there a way to import all methods and attributes of a module dynamically in Python 2.7?</p>