Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Devops
  3. Question
Devops

How can I use Jinja2 for writing conditional coding?

Asked by David Piper Jul 1, 2024 1.1K views 1 answer
Share

About this question

I am currently engaged in a particular task that is related to working on a web-based application that displays a profile of a user. I need to show different messages which should be based on whether the user has provided an email address or not. How can I use the Jinja2 templating for writing the code for displaying the following messages:

      • If the user has provided an email address, display “Your email is (user email)
      • If the user has not provided an email address, display, “You have not provided your email address”. 

Your answer

1 Answer

More Devops discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest DevOps Blogs

Guides, tips and career advice on DevOps from JanBask experts.