What is the correct syntax to use a variable in the Django template?

17. What is the correct syntax to use a variable in the Django template?

  1. {{ variable_name }}
  2. < variable_name >
  3. << variable_name >>
  4. " variable_name "

Answer: A) {{ variable_name }}

Explanation:

If you want to use a variable in the Django template, you need to follow the below-given syntax:

{{ variable_name }}

Let's suppose there is a variable named "email", and you want to use it inside a Django template. Then you have to write it inside the double curly opening and closing braces.

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.