Snippets Collections
from flask import Flask,render_template,request, redirect
 
 
app = Flask(__name__)
app.config['SECRET_KEY'] = 'dajdsjas'
 
 
@app.route('/home')
def home():
    return 'Home page'
 
 
 
@app.route('/take_parameter', methods = ["POST"])
def takeparam():
    try:
        pas = request.args(silent=True)
        #app.logger.info(json)
        return 'OK'
    except:
        return 'INTERNAL ERROR', 500
    
 
@app.route('/take_json', methods = ["POST"])
def takejson():
    try:
        pas = request.get_json(silent=True)
        #app.logger.info(json)
        return 'OK'
    except:
        return 'INTERNAL ERROR', 500
    
if __name__ =='__main__':
    app.run(debug=True)
 
bookmark
dashboard

Thu Oct 22 2020 09:00:37 GMT+0000 (UTC)

#python #flask
bookmark
dashboard

Wed May 13 2020 18:55:25 GMT+0000 (UTC) https://www.youtube.com/watch?v=zdgYw-3tzfI

#flask

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension