{"id":103266,"date":"2021-07-01T11:00:00","date_gmt":"2021-07-01T08:00:00","guid":{"rendered":"https:\/\/examples.javacodegeeks.com\/?p=103266"},"modified":"2021-06-29T15:37:40","modified_gmt":"2021-06-29T12:37:40","slug":"how-to-use-python-flask-wtforms","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/how-to-use-python-flask-wtforms\/","title":{"rendered":"How To Use Python Flask-WTForms"},"content":{"rendered":"<p>Hello in this tutorial, we will see how to use Flask WTForms in Python, through a simple application.<\/p>\n<h2>1. Introduction<\/h2>\n<p>WTF in python is used to create an interactive form in the flask web applications and also serves as the validation library for the form. What is useful:<\/p>\n<ul>\n<li>The form elements are sent with the request object from the client to the server-side<\/li>\n<li>Server-side script recreates the form element as there is no mapping between the client HTML form elements and variables used at the server-side<\/li>\n<li>WTF does not allow rendering HTML form data in real-time<\/li>\n<\/ul>\n<h3>1.1 WT form fields<\/h3>\n<p>The following table shows the standard form fields \u2013<\/p>\n<table>\n<tbody>\n<tr>\n<th style=\"text-align: center;\">Form Field<\/th>\n<th style=\"text-align: center;\">Description<\/th>\n<\/tr>\n<tr>\n<td>TextField<\/td>\n<td>Represent the text field HTML form element<\/td>\n<\/tr>\n<tr>\n<td>BooleanField<\/td>\n<td>Represent the checkbox HTML form element<\/td>\n<\/tr>\n<tr>\n<td>DecimalField<\/td>\n<td>Represent the text field to display the numbers with decimals<\/td>\n<\/tr>\n<tr>\n<td>IntegerField<\/td>\n<td>Represent the text field to display the integer values<\/td>\n<\/tr>\n<tr>\n<td>RadioField<\/td>\n<td>Represent the radio button HTML form element<\/td>\n<\/tr>\n<tr>\n<td>SelectField<\/td>\n<td>Represent the select form element<\/td>\n<\/tr>\n<tr>\n<td>TextAreaField<\/td>\n<td>Represent the text area HTML form element<\/td>\n<\/tr>\n<tr>\n<td>PasswordField<\/td>\n<td>Used to take the password as the form input from the user<\/td>\n<\/tr>\n<tr>\n<td>SubmitField<\/td>\n<td>It provides represents the &lt;input type = &#8216;submit&#8217; value = &#8216;Submit&#8217;&gt; html form element<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>2. Setting up Python and important modules<\/h2>\n<p>To start with this tutorial we will need to install Python and set up some of the python libraries. Let us go ahead and install them one by one.<\/p>\n<h3>2.1 Setting up Python<\/h3>\n<p>If someone needs to go through the Python installation on Windows, please watch <a href=\"https:\/\/www.youtube.com\/watch?v=i-MuSAwgwCU\" target=\"_blank\" rel=\"noopener\">this<\/a> link. You can download the Python from <a href=\"https:\/\/www.python.org\/downloads\/\" target=\"_blank\" rel=\"noopener\">this<\/a> link.<\/p>\n<h3>2.2 Setting up Flask libraries<\/h3>\n<p>Once the python is successfully installed on your system you can install the <strong>Flask<\/strong> and <strong>Flask-WTF<\/strong> modules using a simple <code>pip<\/code> command. You can fire the below command from the command prompt and it will successfully download the modules from <a href=\"https:\/\/pypi.org\/project\/Flask\/\" target=\"_blank\" rel=\"noopener\">pypi.org<\/a> and install it.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p><span style=\"text-decoration: underline;\"><em>Installation command<\/em><\/span><\/p>\n<pre class=\"brush:python;\">pip install -U Flask Flask-WTF\n<\/pre>\n<h2>3. How To Use Python Flask-WTForms<\/h2>\n<p>I am using <a href=\"https:\/\/www.jetbrains.com\/pycharm\/\" target=\"_blank\" rel=\"noopener\">JetBrains PyCharm<\/a> as my preferred IDE. You&#8217;re free to choose the IDE of your choice.<\/p>\n<h3>3.1 Creating an implementation file<\/h3>\n<p>Add the following code to the python script. The file will contain the Flask app, routes, and form using the Flask WTF module. WT form will use the <code>SECRET_KEY<\/code> as a CSRF token to the application.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>app.py<\/em><\/span><\/p>\n<pre class=\"brush:python;\"># python - wt forms tutorial\n\n# modules\nfrom os import urandom\n\nfrom flask import Flask, render_template\nfrom flask_wtf import FlaskForm\nfrom wtforms import StringField, SubmitField\nfrom wtforms.validators import DataRequired, Length\n\napp = Flask(__name__, template_folder='.')\napp.config['SECRET_KEY'] = urandom(16)\n\n\n# user form class\nclass WelcomeUserForm(FlaskForm):\n    name = StringField(label='Enter name: ',\n                       validators=[\n                           DataRequired(message='Name is required'),\n                           Length(min=4, message='Name must be greater than %(min)d characters')\n                       ])\n    submit = SubmitField(label='Submit')\n\n\n# application endpoint to render the html file and perform post op\n# endpoint - http:\/\/127.0.0.1:5000\/\n@app.route('\/', methods=['GET', 'POST'])\ndef welcome():\n    form = WelcomeUserForm()\n    if form.validate_on_submit():\n        return f'''&lt;h4&gt;Hello {form.name.data}&lt;\/h4&gt;'''\n\n    return render_template('form.html', form=form)\n\n\n# driver code\nif __name__ == '__main__':\n    app.run(debug=False)\n<\/pre>\n<h3>3.2 Creating an implementation file<\/h3>\n<p>Add the following code to the HTML file. We will use the <code>form<\/code> object to pass the WT form elements into the template parser for the Flask. The CSRF token protect the application against CSRF attacks.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>form.html<\/em><\/span><\/p>\n<pre class=\"brush:html;\">&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n&lt;head&gt;\n    &lt;meta charset=\"UTF-8\"\/&gt;\n    &lt;link rel=\"stylesheet\" href=\"https:\/\/maxcdn.bootstrapcdn.com\/bootstrap\/3.4.1\/css\/bootstrap.min.css\"&gt;\n    &lt;title&gt;Welcome&lt;\/title&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n&lt;form method=\"POST\" action=\"\"&gt;\n    &lt;div class=\"form-row\"&gt;\n        &lt;div class=\"form-group col-md-6\"&gt;\n            {{ form.csrf_token() }}\n            &lt;label class=\"control-label col-sm-2\"&gt; {{ form.name.label }}&lt;\/label&gt;\n            &lt;div class=\"col-sm-10\"&gt;\n                {{ form.name }}\n            &lt;\/div&gt;\n            {% for field, errors in form.errors.items() %}\n            &lt;small class=\"form-text text-muted\"&gt;\n                {{ ', '.join(errors) }}\n            &lt;\/small&gt;\n            {% endfor %}\n        &lt;\/div&gt;\n        &lt;div class=\"form-group\"&gt;{{ form.submit(class=\"btn btn-primary\") }}&lt;\/div&gt;\n    &lt;\/div&gt;\n&lt;\/form&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;\n<\/pre>\n<h2>4. Run the application<\/h2>\n<p>Run this <code>app.py<\/code> script and the application will be started on the port number \u2013 <code>5000<\/code>. Once the application is started successfully open the browser of your choice and hit the localhost endpoint.<\/p>\n<pre class=\"brush:plain;\">http:\/\/127.0.0.1:5000\/\n<\/pre>\n<p>The index page will be shown to the user as shown in Fig. 1.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/06\/demo-img-guide1.jpg\"><img decoding=\"async\" width=\"818\" height=\"121\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/06\/demo-img-guide1.jpg\" alt=\"flask wtforms - index page\" class=\"wp-image-103269\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/06\/demo-img-guide1.jpg 818w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/06\/demo-img-guide1-300x44.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/06\/demo-img-guide1-768x114.jpg 768w\" sizes=\"(max-width: 818px) 100vw, 818px\" \/><\/a><figcaption>Fig. 1: Index page<\/figcaption><\/figure>\n<\/div>\n<p>Enter a name in the input field and the greeting message will be shown to the user as per the route defined in the <code>app.py<\/code> script.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/06\/demo-img-guide2.jpg\"><img decoding=\"async\" width=\"818\" height=\"121\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/06\/demo-img-guide2.jpg\" alt=\"flask wtforms - welcome page\" class=\"wp-image-103270\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/06\/demo-img-guide2.jpg 818w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/06\/demo-img-guide2-300x44.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/06\/demo-img-guide2-768x114.jpg 768w\" sizes=\"(max-width: 818px) 100vw, 818px\" \/><\/a><figcaption>Fig. 2: Welcome page<\/figcaption><\/figure>\n<\/div>\n<p>The HTML form also consists of the validation such as required or max length for the name field and will be shown to the user if the form validation fails as shown in Fig. 3.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/06\/demo-img-guide3.jpg\"><img decoding=\"async\" width=\"396\" height=\"119\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/06\/demo-img-guide3.jpg\" alt=\"\" class=\"wp-image-103271\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/06\/demo-img-guide3.jpg 396w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/06\/demo-img-guide3-300x90.jpg 300w\" sizes=\"(max-width: 396px) 100vw, 396px\" \/><\/a><figcaption>Fig. 3: Form validation<\/figcaption><\/figure>\n<\/div>\n<p>That is all for this tutorial and I hope the article served you with whatever you were looking for. Happy Learning and do not forget to share!<\/p>\n<h2>5. Summary<\/h2>\n<p>This was the tutorial to learn about the WT forms in python programming where we saw that the WT forms are responsible to create interactive forms in flask web applications and also support form validation. You are free to change the source code and can download it from the <a href=\"#projectDownload\">Downloads<\/a> section.<\/p>\n<h2><a name=\"projectDownload\"><\/a>6. Download the Project<\/h2>\n<p>This was a tutorial on how to use WT forms in python programming.<\/p>\n<div class=\"download\"><strong>Download<\/strong><br \/>You can download the full source code of this example here: <a href=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/06\/How-To-Use-Python-Flask-WTForms.zip\"><strong>How To Use Python Flask-WTForms<\/strong><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Hello in this tutorial, we will see how to use Flask WTForms in Python, through a simple application. 1. Introduction WTF in python is used to create an interactive form in the flask web applications and also serves as the validation library for the form. What is useful: The form elements are sent with the &hellip;<\/p>\n","protected":false},"author":119,"featured_media":99891,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46689],"tags":[1716],"class_list":["post-103266","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-python"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How To Use Python Flask-WTForms - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Hello in this tutorial, we will see how to use Flask WTForms in Python, through a simple application. 1. Introduction WTF in python is used to create an\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/examples.javacodegeeks.com\/how-to-use-python-flask-wtforms\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Use Python Flask-WTForms - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Hello in this tutorial, we will see how to use Flask WTForms in Python, through a simple application. 1. Introduction WTF in python is used to create an\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/how-to-use-python-flask-wtforms\/\" \/>\n<meta property=\"og:site_name\" content=\"Examples Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-01T08:00:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Yatin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Yatin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/how-to-use-python-flask-wtforms\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/how-to-use-python-flask-wtforms\/\"},\"author\":{\"name\":\"Yatin\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/9874407a37b028e8be3276e2b5960d13\"},\"headline\":\"How To Use Python Flask-WTForms\",\"datePublished\":\"2021-07-01T08:00:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/how-to-use-python-flask-wtforms\/\"},\"wordCount\":643,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/how-to-use-python-flask-wtforms\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python-logo.jpg\",\"keywords\":[\"python\"],\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/how-to-use-python-flask-wtforms\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/how-to-use-python-flask-wtforms\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/how-to-use-python-flask-wtforms\/\",\"name\":\"How To Use Python Flask-WTForms - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/how-to-use-python-flask-wtforms\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/how-to-use-python-flask-wtforms\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python-logo.jpg\",\"datePublished\":\"2021-07-01T08:00:00+00:00\",\"description\":\"Hello in this tutorial, we will see how to use Flask WTForms in Python, through a simple application. 1. Introduction WTF in python is used to create an\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/how-to-use-python-flask-wtforms\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/how-to-use-python-flask-wtforms\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/how-to-use-python-flask-wtforms\/#primaryimage\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python-logo.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python-logo.jpg\",\"width\":150,\"height\":150,\"caption\":\"set python\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/how-to-use-python-flask-wtforms\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/examples.javacodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Web Development\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/web-development\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Python\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/web-development\/python\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"How To Use Python Flask-WTForms\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Examples and Code Snippets\",\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/javacodegeeks\",\"https:\/\/x.com\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/9874407a37b028e8be3276e2b5960d13\",\"name\":\"Yatin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2023\/09\/cropped-Yatin-Batra_avatar_1515758148-96x96.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2023\/09\/cropped-Yatin-Batra_avatar_1515758148-96x96.jpg\",\"caption\":\"Yatin\"},\"description\":\"An experience full-stack engineer well versed with Core Java, Spring\/Springboot, MVC, Security, AOP, Frontend (Angular &amp; React), and cloud technologies (such as AWS, GCP, Jenkins, Docker, K8).\",\"sameAs\":[\"https:\/\/www.javacodegeeks.com\"],\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/yatin-batra\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Use Python Flask-WTForms - Java Code Geeks","description":"Hello in this tutorial, we will see how to use Flask WTForms in Python, through a simple application. 1. Introduction WTF in python is used to create an","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/examples.javacodegeeks.com\/how-to-use-python-flask-wtforms\/","og_locale":"en_US","og_type":"article","og_title":"How To Use Python Flask-WTForms - Java Code Geeks","og_description":"Hello in this tutorial, we will see how to use Flask WTForms in Python, through a simple application. 1. Introduction WTF in python is used to create an","og_url":"https:\/\/examples.javacodegeeks.com\/how-to-use-python-flask-wtforms\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2021-07-01T08:00:00+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python-logo.jpg","type":"image\/jpeg"}],"author":"Yatin","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Yatin","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/how-to-use-python-flask-wtforms\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/how-to-use-python-flask-wtforms\/"},"author":{"name":"Yatin","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/9874407a37b028e8be3276e2b5960d13"},"headline":"How To Use Python Flask-WTForms","datePublished":"2021-07-01T08:00:00+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/how-to-use-python-flask-wtforms\/"},"wordCount":643,"commentCount":0,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/how-to-use-python-flask-wtforms\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python-logo.jpg","keywords":["python"],"articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/how-to-use-python-flask-wtforms\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/how-to-use-python-flask-wtforms\/","url":"https:\/\/examples.javacodegeeks.com\/how-to-use-python-flask-wtforms\/","name":"How To Use Python Flask-WTForms - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/how-to-use-python-flask-wtforms\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/how-to-use-python-flask-wtforms\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python-logo.jpg","datePublished":"2021-07-01T08:00:00+00:00","description":"Hello in this tutorial, we will see how to use Flask WTForms in Python, through a simple application. 1. Introduction WTF in python is used to create an","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/how-to-use-python-flask-wtforms\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/how-to-use-python-flask-wtforms\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/how-to-use-python-flask-wtforms\/#primaryimage","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python-logo.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2021\/02\/python-logo.jpg","width":150,"height":150,"caption":"set python"},{"@type":"BreadcrumbList","@id":"https:\/\/examples.javacodegeeks.com\/how-to-use-python-flask-wtforms\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/examples.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Web Development","item":"https:\/\/examples.javacodegeeks.com\/category\/web-development\/"},{"@type":"ListItem","position":3,"name":"Python","item":"https:\/\/examples.javacodegeeks.com\/category\/web-development\/python\/"},{"@type":"ListItem","position":4,"name":"How To Use Python Flask-WTForms"}]},{"@type":"WebSite","@id":"https:\/\/examples.javacodegeeks.com\/#website","url":"https:\/\/examples.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Examples and Code Snippets","publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/examples.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/examples.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/9874407a37b028e8be3276e2b5960d13","name":"Yatin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2023\/09\/cropped-Yatin-Batra_avatar_1515758148-96x96.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2023\/09\/cropped-Yatin-Batra_avatar_1515758148-96x96.jpg","caption":"Yatin"},"description":"An experience full-stack engineer well versed with Core Java, Spring\/Springboot, MVC, Security, AOP, Frontend (Angular &amp; React), and cloud technologies (such as AWS, GCP, Jenkins, Docker, K8).","sameAs":["https:\/\/www.javacodegeeks.com"],"url":"https:\/\/examples.javacodegeeks.com\/author\/yatin-batra\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/103266","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/users\/119"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=103266"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/103266\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media\/99891"}],"wp:attachment":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=103266"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=103266"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=103266"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}