testlist is just a list of objects. for instance
testlist.0.name
- it's just "Test3"
I have a temp.html file
{% extends 'base.html' %} {% block content %} {{testlist.0.name | safe}} {% endblock %}
that everything in temp.html and base.html works fine with all other html files that use it
temp.html gives me
TemplateSyntaxError at /mytests/ Could not parse the remainder: ' | safe' from 'testlist.0.name | safe' Request Method: GET Request URL: http://127.0.0.1:8000/mytests/ Django Version: 1.4 Exception Type: TemplateSyntaxError Exception Value: Could not parse the remainder: ' | safe' from 'testlist.0.name | safe'
when i change it to:
{% extends 'base.html' %} {% block content %} {{testlist.0.lastedited |date:"SHORT_DATE_FORMAT" }} {% endblock %}
it gives me
TemplateSyntaxError at /mytests/ could not parse some characters: testlist.0.lastedited| ||date:"SHORT_DATE_FORMAT" Request Method: GET Request URL: http://127.0.0.1:8000/mytests/ Django Version: 1.4 Exception Type: TemplateSyntaxError Exception Value: Could not parse some characters: testlist.0.lastedited| ||date:"SHORT_DATE_FORMAT"
you get the idea. It seems like I just can't use filters in my django templates. I tried other filters and still got the same thing. Am I missing some parameters that allow me to use the channel symbol? Could it be that "|" The key on my macbook pro is not a channel character, but some other character that django does not recognize?
source share