Created
December 8, 2016 23:03
-
-
Save felipebastosweb/5838939594f8e7f25739c15317006144 to your computer and use it in GitHub Desktop.
View escola index renderizando o template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.http import HttpResponse | |
from django.template import loader | |
from .models import Escola, EscolaSegmento, Serie, Turma | |
def index(request): | |
escolas = Escola.objects.all() | |
template = loader.get_template('escola/index.html') | |
context = { | |
'escolas' : escolas, | |
} | |
return HttpResponse(template.render(context, request)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment