Created
April 1, 2015 20:17
-
-
Save burnash/e60351e2696f4d17a466 to your computer and use it in GitHub Desktop.
How to extend Django settings variables with local_settings.py
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
# Code from Mikko Hellsing: | |
# http://www.robgolding.com/blog/2010/05/03/extending-settings-variables-with-local_settings-py-in-django/#comment-51863642 | |
def get_setting(setting): | |
import settings | |
return getattr(settings, setting) | |
INSTALLED_APPS = get_setting('INSTALLED_APPS') + ('debug_toolbar', ) | |
MIDDLEWARE_CLASSES = get_setting('MIDDLEWARE_CLASSES') + ('debug_toolbar.middleware.DebugToolbarMiddleware',) | |
INTERNAL_IPS = ('127.0.0.1',) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment