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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:01:33+00:00 2026-06-12T17:01:33+00:00

My problem occurs when I try to pass 3 variables to my template tag

  • 0

My problem occurs when I try to pass 3 variables to my template tag which I guess takes one or 2 inputs. So any ideas on how to pass 3 template variables to my template tag and here is my code:

views.py:

from shoghlanah.models import *

register = template.Library()

@register.simple_tag
def get_messages(sender_id,receiver_id,task_id):
    sender = UserProfile.objects.get(id = sender_id)
    receiver =UserProfile.objects.get(id = receiver_id)
    task = Task.objects.get(id=task_id)
    return messages

message.html :

the url.id and the task_id are template variables

{{ get_messages request.user.id usr.id task_id }}

it gives me an error : Could not parse the remainder: ‘ request.user.id usr.id task_id’ from ‘get_messages request.user.id usr.id task_id’

  • 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-12T17:01:34+00:00Added an answer on June 12, 2026 at 5:01 pm

    For a django tag, you need to use {% %}, not the double curly brackets. The double braces signify outputting a value.

    See the docs for more.

    (Just as a note, I presume that is an extract, but you will also need to {% load %} your tag too.)

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

Sidebar

Related Questions

My problem occurs when I try to load multiple images in one class in
The problem occurs when i try to manipulate an image uploaded from sinatra. File.open(params[:file][:tempfile])
This problem occurs when I try to hide a file in my directory with
The problem occurs when I do a division operation. I would like to know
Strange problem occurs on the production platform (64 bit win 2008 server). It is
Note: This problem occurs only on Mac, on Windows works fine. I have a
Seems like cuke doesn't show the full error message (at least when problem occurs
When i put an NSOpenglView in NSSplitView, a problem occurs while dragging splitter. The
Tomcat does not encode correctly String literals that contain unicode characters. The problem occurs
I have a problem that occurs only in a production environment, deployed at heroku.

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.