tessl install tessl/pypi-flask-wtf@1.2.0Form rendering, validation, and CSRF protection for Flask with WTForms.
Agent Success
Agent success rate when using this tile
72%
Improvement
Agent success rate improvement when using this tile compared to baseline
0.91x
Baseline
Agent success rate without this tile
79%
Build a Flask application that implements CSRF-protected forms with time-limited tokens to prevent replay attacks.
Create a Flask application with CSRF protection that expires tokens after 2 minutes. The application should:
Your application needs the following endpoints:
/form: Returns an HTML form with CSRF protection/submit: Processes the form submission with CSRF validationThe form should include:
When processing submissions:
@generates
from flask import Flask
app = Flask(__name__)
@app.route('/form', methods=['GET'])
def form():
"""Return HTML form with CSRF protection."""
pass
@app.route('/submit', methods=['POST'])
def submit():
"""Process form submission with CSRF validation."""
passProvides CSRF protection with configurable time limits for Flask applications.
@satisfied-by