Skip to content

Instantly share code, notes, and snippets.

@zellyn
Created November 24, 2009 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zellyn/241869 to your computer and use it in GitHub Desktop.
Save zellyn/241869 to your computer and use it in GitHub Desktop.
from helpers import override_settings
KONG_DEFAULT_SERVERNAME = 'ljworld.com'
KONG_DEFAULT_PYTHONPATH = '/home/code'
override_settings(globals())
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