In your views.py template definition, create a query variable and return it like this:
def your_template(request):
cursor = connection.cursor()
try:
cursor.execute("SELECT DISP FROM INDTIMEN WHERE PAIS_SERV_PRODID = 'VEN_UY_POS' AND AÑO = 2019 AND MES = 10 AND INDIS != 0")
finally:
cursor.close()
query = cursor.fetchall()
return render(request, 'folder/template.html',{'query': query})
In your template.html file, use a for loop in order to display the result of the query as html:
{% for obj in query %}
<p>{{obj.0}}</p>
{% endfor %}
Note: If your query displays only one result, you can change the code to this:
def your_template(request):
cursor = connection.cursor()
try:
cursor.execute("SELECT DISP FROM INDTIMEN WHERE PAIS_SERV_PRODID = 'VEN_UY_POS' AND AÑO = 2019 AND MES = 10 AND INDIS != 0")
finally:
cursor.close()
query = cursor.fetchone()
return render(request, 'folder/template.html',{'query': query})
In your template.html file, display the result of the query as html:
<p>{{obj.0}}</p>