Form rendering, validation, and CSRF protection for Flask with WTForms.
72
Build a simple web application that displays a contact form with internationalization support for English and Spanish. The form should validate user input and display error messages in the user's preferred language.
Create a Flask application with the following features:
Language Selection: Support two languages - English (en) and Spanish (es). The application should detect the language from a query parameter lang (e.g., /contact?lang=es), defaulting to English if not specified.
Contact Form: Create a form with the following fields:
Validation Messages: When the form fails validation, error messages should be displayed in the appropriate language:
Form Rendering: Create a template that displays the form and shows validation errors when present.
/contact that handles both GET (display form) and POST (process submission) requests?lang=es displays validation error messages in Spanish @test@generates
Provides form handling and CSRF protection for Flask applications.
Provides internationalization and localization support for Flask applications.
Install with Tessl CLI
npx tessl i tessl/pypi-flask-wtfevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10