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

262
Views
Django, variable {{ }} inside {% %}

I'm using Django-instagram for simply display Instagram content on my webpage:

{% load instagram_client %}
{% instagram_user_recent_media intel %}

This example works perfect, but the problem is Instagram name changes depending on selected page. I pass it via context:

def about(request, foo_id):
    article = get_object_or_404(Bar, id=foo_id)
    return render_to_response('about.html', {'foo' : article})

It works fine if I'm using it without template:

<p>{{ foo.instagram }}</p> --> returns valid name

How can I pass my "foo.instagram" like this:

{% load instagram_client %}
{% instagram_user_recent_media {{ foo.instagram }} %}
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You can use set:

{% set new_var = foo.instagram -%}
{% load instagram_client %}
{% instagram_user_recent_media new_var %}
over 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!