Created
March 18, 2013 09:56
-
-
Save venkatesh22/5186095 to your computer and use it in GitHub Desktop.
Override render to response and change templates folder dynamically
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 django.shortcuts import render_to_response as super_render_to_response | |
def render_to_response(*args, **kwargs): | |
""" | |
Here overriding existing render_to_response method and | |
changing template if other configuration is enabled | |
""" | |
config = True | |
if config: | |
args = 'config/' + args[0], | |
return super_render_to_response(*args, **kwargs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment