How do I call a Django function without button click.. I want to pass a variable value from views.py & i need to use in template language without forms.
CodePudding user response:
for example..
in your views :
def PageView(request):
return render(request, 'yourhtml.html', {'variable_name': 'Value Of Variable'})
and in your html page:
<p> {{ variable_name }} </p>
and it will return <p> Value Of Variable </p>