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 8732627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:28:21+00:00 2026-06-13T09:28:21+00:00

So, in template.html I use: {% if dict %} {{ s={} }} {% endif

  • 0

So, in template.html I use:

{% if dict %}
{{ s={} }}
{% endif %}

The error is – Could not parse the remainder: ‘={}’ from ‘s={}’. How to fix it?

  • 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-13T09:28:22+00:00Added an answer on June 13, 2026 at 9:28 am

    Django templates shouldn’t really be used for making dictionaries, they should be made in your views and only basic processing should be done in the templates.

    It’s this way on purpose to strictly adhere to the MVC design pattern.

    See from here: https://docs.djangoproject.com/en/dev/topics/templates/

    Philosophy

    If you have a background in programming, or if you’re used
    to languages like PHP which mix programming code directly into HTML,
    you’ll want to bear in mind that the Django template system is not
    simply Python embedded into HTML. This is by design: the template
    system is meant to express presentation, not program logic.

    The Django template system provides tags which function similarly to
    some programming constructs – an if tag for boolean tests, a for tag
    for looping, etc. – but these are not simply executed as the
    corresponding Python code, and the template system will not execute
    arbitrary Python expressions. Only the tags, filters and syntax listed
    below are supported by default (although you can add your own
    extensions to the template language as needed).

    By the looks of things you want to create a dict based on some condition. You should probably rearrange your logic and create the dict in the view — you also get to leverage all the power of python this way.

    There’s probably be a ton of workarounds for your situation if you describe it in more detail.

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

Sidebar

Related Questions

I would like to use the HTML::Template module. However, it is not installed on
my question is how would I use an HTML::Template tag inside a value of
I tried to use an image file in my HTML template. But when I
How do I use an HTML as a template then just replace the text
We use spark to generate HTML-mails. When merging our data into the template I
I want to use HTML template in Timer Job. My timer job is to
is it possible to use an external Template in KnockoutJS like this? <script type=text/html
I often use HTML template for my application and within the template content there
I'm trying to use a php function within a template html form that is
I want to parse a folder of template HTML files and cache (or buffer)

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.