Answers for "jinja2"

1

jinja2 python

<title>{% block title %}{% endblock %}</title>
<ul>
{% for user in users %}
  <li><a href="{{ user.url }}">{{ user.username }}</a></li>
{% endfor %}
</ul>
Posted by: Guest on September-24-2020
0

jinja2

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div class = "container">
      <h1>
        Hi my name is {{ name }}
      </h1>
    </div>
</body>
</html>
Posted by: Guest on April-21-2021
0

jinja2

import flask 
from flask import Flask , render_templates

app = Flask(__name__)
@app.route("/")
def hi():
  name = "Your Name"
  return render_templates(index.html , name = name)

# The html code below this code is mine
Posted by: Guest on April-21-2021

Python Answers by Framework

Browse Popular Code Answers by Language