(self, template_file, template_values, status=200)
Renders HTML given a template filename and values.

    Args:
      template_file: string. File name under templates directory.
      template_values: dict. Mapping of template variables to corresponding
          values.
      status: int. HTTP status code.
Renders HTML given a template filename and values.
Renders HTML given a template filename and values .
def RenderHtml(self, template_file, template_values, status=200):
    """Renders HTML given a template filename and values.

    Args:
      template_file: string. File name under templates directory.
      template_values: dict. Mapping of template variables to corresponding
          values.
      status: int. HTTP status code.
    """
    self.response.set_status(status)
    user = users.get_current_user()
    template_values['user'] = user

    # Provide a versioned static URI for templates to use.
    template_values['static_dir'] = ('/_static/%s' %
                                     os.environ['CURRENT_VERSION_ID'])
    template_values['env'] = self.env

    if http_util.GetBoolParam(self.request, 'debug',
                              os.environ.get('PKE_DEBUG', False)):
      template_values['min'] = ''
    else:
      template_values['min'] = '.min'

    if users.get_current_user():
      template_values['current_user_email'] = users.get_current_user().email()
    template_values['current_user_admin'] = str(
        users.is_current_user_admin()).lower()
    current_config = self.config.to_dict()

    template_values['analytics_key'] = current_config['analytics_key']
    template_values['initial_config'] = json.dumps(current_config)

    template = _JINJA_ENVIRONMENT.get_template(template_file)
    self.response.headers['Content-Type'] = 'text/html; charset=utf-8'
    self.response.out.write(template.render(template_values))
def RenderHtml ( self , template_file , template_values , status = 200 ) : self . response . set_status ( status ) user = users . get_current_user ( ) template_values [ 'user' ] = user # Provide a versioned static URI for templates to use. template_values [ 'static_dir' ] = ( '/_static/%s' % os . environ [ 'CURRENT_VERSION_ID' ] ) template_values [ 'env' ] = self . env if http_util . GetBoolParam ( self . request , 'debug' , os . environ . get ( 'PKE_DEBUG' , False ) ) : template_values [ 'min' ] = '' else : template_values [ 'min' ] = '.min' if users . get_current_user ( ) : template_values [ 'current_user_email' ] = users . get_current_user ( ) . email ( ) template_values [ 'current_user_admin' ] = str ( users . is_current_user_admin ( ) ) . lower ( ) current_config = self . config . to_dict ( ) template_values [ 'analytics_key' ] = current_config [ 'analytics_key' ] template_values [ 'initial_config' ] = json . dumps ( current_config ) template = _JINJA_ENVIRONMENT . get_template ( template_file ) self . response . headers [ 'Content-Type' ] = 'text/html; charset=utf-8' self . response . out . write ( template . render ( template_values ) )