Skip to content

Instantly share code, notes, and snippets.

@Marceloromeugoncalves
Created July 7, 2021 14:57
Show Gist options
  • Save Marceloromeugoncalves/8f8a2e7581986f4cc105d1850170e68b to your computer and use it in GitHub Desktop.
Save Marceloromeugoncalves/8f8a2e7581986f4cc105d1850170e68b to your computer and use it in GitHub Desktop.
Renderizando um template como uma string.
from django.http import HttpResponse
from django.template.loader import render_to_string
def index(request):
t = render_to_string("blog/template.html")
return HttpResponse(t)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment