0

I am using Jinja templates in a Flask-based web application. I would like to do some conditional branching on the domain name in the HTML template. For example,

{% if domain_name == 'www.abc.com' %}
// do this
{% elif domain_name == 'www.xyz.com' %}
// do this
{% else %}
// do this

Is there a way to get the domain name without having to pass the domain name as an argument to render_template?

Is it possible to get the domain name from the session object, or a function?

ktm5124
  • 11,298
  • 19
  • 67
  • 107

0 Answers0