Renderizando HTML, render, templates, INSTALLED_APPS e TemplateDoesNotExist
This commit is contained in:
12
aula207_ola_django/home/templates/home/index.html
Normal file
12
aula207_ola_django/home/templates/home/index.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>HOME 2</h1>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,8 +1,10 @@
|
||||
from django.http import HttpResponse
|
||||
|
||||
# from django.shortcuts import render
|
||||
from django.shortcuts import render
|
||||
|
||||
|
||||
def home(request):
|
||||
print('home')
|
||||
return HttpResponse('home do app 1')
|
||||
|
||||
return render(
|
||||
request,
|
||||
'home/index.html'
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user