Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to display python output on html page django

# Save it to a context variable in the views and pass it into the template

# In your views.py file
def index(request):
	output = 5 + 6    
    context = {'output' = output}
    return render(request, 'index.html', context)

# In your index.html template file
<html> {{ output }} </html>
 
PREVIOUS NEXT
Tagged: #display #python #output #html #page #django
ADD COMMENT
Topic
Name
5+7 =