Wednesday, May 27, 2020

Can we use python related api's on the Django templates ?

Hi all, 

Currently I am trying to print the type of a variable from the Django template html file as follows: 

    <center><h2>The type of feature list report for version {%type(version)%} is<h2></center>

For the above, I am getting the following error: 
Invalid block tag on line 9: 'type(version)'. Did you forget to register or load this tag?

So what's going wrong here? How can we use the python related api's (like type) from the html template files? I think inside the {% .... %} we can use python related evaluations. Am I right? 

Please throw some lights on this .

Thanks. 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2863977e-c712-4746-bbb0-b175bc976a0d%40googlegroups.com.

No comments:

Post a Comment