I am trying to create a simple form using Flask in python. I am trying to use jinja2 template to display the form. But the template objects are not creating corresponding html elements and just printing the form field object as text.
This is the flask code block
from flask import Flask
from flask import render_template
from flask_wtf import FlaskForm
from wtforms import IntegerField
app = Flask(__name__)
class TestForm():
value = IntegerField('Value')
@app.route('/', methods = ['GET', 'POST'])
def test():
form = TestForm()
return render_template('template.html', form = form)
This is the html template I have
<!DOCTYPE html>
<html>
<head>
<title>Title</title>
</head>
<body>
<p>Test Page !!</p>
<div>
<form method="post">
{{ form.csrf_token }}
{{ form.value.label }}
{{ form.value }}
<input type="submit">
</form>
</div>
</body>
</html>
This is how the webpage looks like
I am not sure why the html elements corresponding to the form are not displaying. Any idea why this might be happening. I am trying to run this on Windows in an anaconda python environment. I haven't had issues previously on ubuntu.