Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

156
Views
Use django template tag inside {{ verbatim }} and {{endverbatim}}

I have template containing lot of angular tags. So I put {{ verbatim }} at top of the html and {{ endverbatim }} at bottom of the html.

Now somewhere between template I need to have one check where, I want to use django template's in-built tag.

e.g.  

{% if user.group.name == "somename" %}  

Is it possible to escape that check?

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I faced pretty same issue, I created a new tag

from django import template
register = template.Library()


@register.simple_tag()
def no_rendering(value):
    return "{{%s}}" % value

And use it as follow (mustache template)

<h3> {% trans "Question" %} {% no_rendering "j" %} </h3>

it will be produce

<h3> Question {{j}} </h3>

I'm my case using {{verbatim}} will print {% trans "Question" %} as is in the mustache template.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!