Skip to content

Commit

Permalink
Troca resposta HTTP por HTML renderizado na primeira rota
Browse files Browse the repository at this point in the history
  • Loading branch information
brnocesar committed Nov 7, 2020
1 parent 3d58da1 commit 19845aa
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
27 changes: 27 additions & 0 deletions apps/receitas/templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Django Receitas</title>
</head>

<body>
<h1>Receitas</h1>

<table>
<thead>
<tr>
<td>Receita</td>
<td>Ingredientes</td>
<td>Preparo</td>
</tr>
</thead>
<tbody>
<td>Vitamina de Banana</td>
<td>Bananas, bolacha de maizena, achocolatado e leite</td>
<td>Bater no liquidificador</td>
</tbody>
</table>
</body>
</html>
3 changes: 1 addition & 2 deletions apps/receitas/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from django.shortcuts import render
from django.http import HttpResponse

def index(request):
return HttpResponse('<h1>Hello Receitas</h1>')
return render(request, 'index.html')

0 comments on commit 19845aa

Please sign in to comment.