<s> import warnings <EOL> import django <EOL> from django . http import HttpResponse <EOL> from django . template import RequestContext , loader <EOL> if django . VERSION < ( <NUM_LIT:1> , <NUM_LIT:8> ) : <EOL> def render ( request , * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> httpresponse_kwargs = { <EOL> '<STR_LIT>' : kwargs . pop ( '<STR_LIT>' , None ) , <EOL> '<STR_LIT:status>' : kwargs . pop ( '<STR_LIT:status>' , None ) , <EOL> } <EOL> if hasattr ( request , '<STR_LIT>' ) and '<STR_LIT>' in request . _feincms_extra_context : <EOL> if '<STR_LIT>' in kwargs : <EOL> kwargs [ '<STR_LIT>' ] [ <EOL> '<STR_LIT>' ] = request . _feincms_extra_context [ '<STR_LIT>' ] <EOL> if '<STR_LIT>' in kwargs : <EOL> context_instance = kwargs . pop ( '<STR_LIT>' ) <EOL> if kwargs . get ( '<STR_LIT>' , None ) : <EOL> raise ValueError ( '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> else : <EOL> current_app = kwargs . pop ( '<STR_LIT>' , None ) <EOL> context_instance = RequestContext ( request , current_app = current_app ) <EOL> kwargs [ '<STR_LIT>' ] = context_instance <EOL> return HttpResponse ( loader . render_to_string ( * args , ** kwargs ) , <EOL> ** httpresponse_kwargs ) <EOL> elif django . VERSION < ( <NUM_LIT:1> , <NUM_LIT:9> ) : <EOL> from django . template . context import _current_app_undefined <EOL> from django . template . engine import ( _context_instance_undefined , <EOL> _dictionary_undefined , _dirs_undefined ) <EOL> def render ( request , template_name , context = { } , <EOL> context_instance = _context_instance_undefined , <EOL> content_type = None , status = None , current_app = _current_app_undefined , <EOL> dirs = _dirs_undefined , dictionary = _dictionary_undefined , <EOL> using = None ) : <EOL> """<STR_LIT>""" <EOL> if hasattr ( request , '<STR_LIT>' ) and '<STR_LIT>' in request . _feincms_extra_context : <EOL> context [ '<STR_LIT>' ] = request . _feincms_extra_context [ '<STR_LIT>' ] <EOL> if ( context_instance is _context_instance_undefined <EOL> and current_app is _current_app_undefined <EOL> and dirs is _dirs_undefined <EOL> and dictionary is _dictionary_undefined ) : <EOL> content = loader . render_to_string ( <EOL> template_name , context , request = request , using = using ) <EOL> else : <EOL> if context_instance is not _context_instance_undefined : <EOL> if current_app is not _current_app_undefined : <EOL> raise ValueError ( '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> else : <EOL> context_instance = RequestContext ( request ) <EOL> if current_app is not _current_app_undefined : <EOL> try : <EOL> from django . utils . deprecation import RemovedInDjango110Warning <EOL> warnings . warn ( <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" , <EOL> RemovedInDjango110Warning , stacklevel = <NUM_LIT:2> ) <EOL> except ImportError : <EOL> pass <EOL> request . current_app = current_app <EOL> context_instance . _current_app = current_app <EOL> content = loader . render_to_string ( <EOL> template_name , context , context_instance , dirs , dictionary , <EOL> using = using ) <EOL> return HttpResponse ( content , content_type , status ) <EOL> else : <EOL> def render ( request , template_name , context = { } , content_type = None , status = None , using = None ) : <EOL> """<STR_LIT>""" <EOL> if hasattr ( request , '<STR_LIT>' ) and '<STR_LIT>' in request . _feincms_extra_context : <EOL> context [ '<STR_LIT>' ] = request . _feincms_extra_context [ '<STR_LIT>' ] <EOL> content = loader . render_to_string ( <EOL> template_name , context , request , using = using ) <EOL> return HttpResponse ( content , content_type , status ) <EOL> def patch_shortcuts ( ) : <EOL> django . shortcuts . render = render </s>
