Last active
October 20, 2015 13:02
-
-
Save beniwohli/fee1397d56f623172adc to your computer and use it in GitHub Desktop.
override template debug in Django 1.8+
This file contains 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
with override_settings( | |
TEMPLATES=[ | |
{ | |
'BACKEND': settings.TEMPLATES[0]['BACKEND'], | |
'DIRS': settings.TEMPLATES[0]['DIRS'], | |
'OPTIONS': { | |
'context_processors': settings.TEMPLATES[0]['OPTIONS']['context_processors'], | |
'loaders': settings.TEMPLATES[0]['OPTIONS']['loaders'], | |
'debug': True, | |
}, | |
}, | |
] | |
): |
This file contains 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 copy import deepcopy | |
TEMPLATES_copy = deepcopy(settings.TEMPLATES) | |
TEMPLATES_copy[0]['OPTIONS']['debug'] = True | |
with override_settings( | |
TEMPLATES=TEMPLATES_copy | |
): |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment