This method accepts the same arguments as the `dict` constructor: A dict, a dict subclass or some keyword arguments. If no arguments are given the context will be empty. These two calls do the same:: template.render(knights='that say nih') template.render({
(self, *args, **kwargs)
| 991 | return t |
| 992 | |
| 993 | def render(self, *args, **kwargs): |
| 994 | """This method accepts the same arguments as the `dict` constructor: |
| 995 | A dict, a dict subclass or some keyword arguments. If no arguments |
| 996 | are given the context will be empty. These two calls do the same:: |
| 997 | |
| 998 | template.render(knights='that say nih') |
| 999 | template.render({'knights': 'that say nih'}) |
| 1000 | |
| 1001 | This will return the rendered template as unicode string. |
| 1002 | """ |
| 1003 | vars = dict(*args, **kwargs) |
| 1004 | try: |
| 1005 | return concat(self.root_render_func(self.new_context(vars))) |
| 1006 | except Exception: |
| 1007 | exc_info = sys.exc_info() |
| 1008 | return self.environment.handle_exception(exc_info, True) |
| 1009 | |
| 1010 | def render_async(self, *args, **kwargs): |
| 1011 | """This works similar to :meth:`render` but returns a coroutine |
nothing calls this directly
no test coverage detected