# coding:utf-8
'''
Created on 2009-12-31

@author: Jason Green
@author-email: guileen@gmail.com

use
`return render_to_response("/my.html", {'key':value,},request)`
instead of
`return render_to_response("/my.html", {'key':value,},new RequestContext(request))`
and you can also use
`return render_to_response("/my.html", {'key':value,},new RequestContext(request))`
'''
import django.template.loader as djloader
from django.template.loader import render_to_string as _original_render_to_string
from django.template.context import RequestContext
def render_to_string(template_name, dictionary=None, context_instance=None):
    if isinstance(context_instance,HttpRequest):
        context_instance = RequestContext(context_instance)
    return _original_render_to_string(template_name, dictionary, context_instance)
djloader.render_to_string = render_to_string