Please, use render_to_string function instead of direct using of templates. https://docs.djangoproject.com/en/dev/ref/templates/api/#the-render-to-string-shortcut