Skip to content

Instantly share code, notes, and snippets.

@csinchok
Created October 24, 2016 19:41
Show Gist options
  • Save csinchok/e9ca9fad53993ce1f948593d821e4c40 to your computer and use it in GitHub Desktop.
Save csinchok/e9ca9fad53993ce1f948593d821e4c40 to your computer and use it in GitHub Desktop.
import sys
import importlib
class SettingsWrapper:
def __init__(self, settings_module=None):
settings_module = sys.environ['APP_SETTINGS_MODULE']
self.wrapped = importlib.__import__(settings_module)
def __getattribute__(self, key):
return getattr(self.wrapped, key)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment