Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8157677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:21:53+00:00 2026-06-06T17:21:53+00:00

testlist is just a list of objects. For example testlist.0.name is simply Test3 I

  • 0

testlist is just a list of objects. For example

testlist.0.name 

is simply “Test3”

I have a file temp.html

{% extends 'base.html' %}
{% block content %}
{{testlist.0.name | safe}}
{% endblock %}

that’s all there is in the temp.html file 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 that I just cannot use any filters in my django templates. I tried other filters and still get the same thing.
Am I missing some options that enable the use of the pipe character? Can it be that the “|” key on my macbook pro is not the pipe character but some other character that django fails to recognise?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T17:21:57+00:00Added an answer on June 6, 2026 at 5:21 pm

    It looks like you need to remove your whitespace between your testlist.0.lastedited and filter. Try something like:

    {% extends 'base.html' %}
    {% block content %}
    {{testlist.0.name|safe}}
    {% endblock %}
    

    I’m guessing this is your problem, since in the docs, they don’t have any whitespace, and they parse the template as a string or something close to it, so whitespace can affect it.

    Template example

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have a list (or Set): List<String> testList = Lists.newArrayList(assocX,srcT,destA,srcX, don't care Y,
I have a list as Users = new List<string>(); I have another List, List<TestList>()
I have a list testList that contains a bunch of strings. I would like
This is my sample code: SPWeb web = SPContext.Current.Web SPList list = web.Lists[TestList]; try
I have a test list that I am trying to capture data from using
If I run this operation on List<Integer> for example, it works as expected (removes
Ok this one is puzzling me. I have an abstract base class named Testbase
I have an ArrayList of objects being dumped to a YAML string and have
I have a list of all the words in the English dictionary (270,000+ words)
I have a jquery datatable using the following code: // Test list table $('#dashboard_testlist_table').dataTable({

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.