Created
November 24, 2009 13:40
-
-
Save zellyn/241869 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from helpers import override_settings | |
KONG_DEFAULT_SERVERNAME = 'ljworld.com' | |
KONG_DEFAULT_PYTHONPATH = '/home/code' | |
override_settings(globals()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf import settings | |
def override_settings(module_dict): | |
""" | |
Given a dictionary of a module (obtained by calling ``globals``, | |
presumably, override any variables also defined in django's | |
settings. | |
""" | |
for key in module_dict: | |
if not key.startswith('__'): | |
try: | |
module_dict[key] = getattr(settings, key) | |
except AttributeError: | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment