Usando o context para enviar dados para dentro dos templates
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
{% extends 'global/base.html' %}
|
||||
|
||||
{% block texto %} MUDAR O TEXTO {% endblock texto %}
|
||||
{% block texto %}
|
||||
{{ text }}
|
||||
{% endblock texto %}
|
||||
|
||||
@@ -4,7 +4,12 @@ from django.shortcuts import render
|
||||
def home(request):
|
||||
print('home')
|
||||
|
||||
context = {
|
||||
'text': 'Olá home'
|
||||
}
|
||||
|
||||
return render(
|
||||
request,
|
||||
'home/index.html'
|
||||
'home/index.html',
|
||||
context,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user