Search
 
SCRIPT & CODE EXAMPLE
 

HTML

how to pass variables from a html form python flask

from flask import request

@app.route('/py', methods=['GET', 'POST'])
def server():
    if request.method == 'POST':
        # Then get the data from the form
        tag = request.form['tag']

        # Get the username/password associated with this tag
        user, password = tag_lookup(tag)

        # Generate just a boring response
        return 'The credentials for %s are %s and %s' % (tag, user, password) 
        # Or you could have a custom template for displaying the info
        # return render_template('asset_information.html',
        #                        username=user, 
        #                        password=password)

    # Otherwise this was a normal GET request
    else:   
        return render_template('main.html')
Comment

PREVIOUS NEXT
Code Example
Html :: passing parameters from C# to js fucntions 
Html :: in form right to left html 
Html :: what are the tags in html that every website have 
Html :: twitter link html 
Html :: what is attributes in html 
Html :: how to add bootstrap carousel 
Html :: html date input pick only date 
Html :: Centered Menu Semantic UI 
Html :: http code 206 
Html :: v-tabs 
Html :: html5 fonts 
Html :: html heading tags 
Html :: navbar tailwind 
Html :: what is erc721 
Html :: HTML <figure and <figcaption Elements 
Html :: how to make link open in new tab 
Html :: random number text in html 
Html :: angular html variable 
Html :: disable submit button after form validation 
Html :: tailwind cards 
Html :: how to auto fit image in div 
Html :: rich text editor mvc razor 
Html :: Double quotation for meta tag strings on html 
Html :: What is ETH2.0? 
Html :: Creating WebLinks in a ReadME 
Html :: equal symbol expected spring form 
Html :: gitbook import html 
Html :: pre-fill the input with the default domain 
Html :: surrealcms content reigons 
Html :: boostrap thymeleaf modal 
ADD CONTENT
Topic
Content
Source link
Name
1+3 =