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 web application with a document upload form that validates file types using predefined upload sets. The application should support two types of documents: images and text documents, with different allowed extensions for each category.
Create a Flask application with the following features:
Upload Configuration: Define two upload categories:
Upload Form: Create a web form with:
Validation: The form should validate uploaded files using the upload set configurations. Invalid file types should trigger appropriate validation errors.
Routes: Implement two routes:
GET /upload: Display the upload formPOST /upload: Handle form submission and validationSuccess Response: When files are successfully validated, return a simple success message showing which files were uploaded (e.g., "Uploaded: photo.jpg and report.pdf").
@generates
Provides the web framework for building the application.
Provides form handling, validation, and file upload support.
Provides upload set configuration for organizing file uploads by type.