Category : flask

the below posted web service receives parameters in json format. please let me know how to access the json/data contained in parameter commented out are my attempts but nothing worked fot me. webservice: @app.route("/insecticidesSpecifications/<parameters>", methods=[‘GET’] ) def insecticidesSpecifications(parameters): print("ok") # response = request.get_json(parameters) # print(request.json()) # logger.debug(response) # json_data = json.loads(response.json) # json_data = response.json ..

Read more

I got a index.html file where multiple option is used within select tag for a drop down: <label for="edu">Education</label> <select id="edu" name="edu"> <option value="0">10th</option> <option value="1">11th</option> <option value="2">12th</option> <option value="3">1st-4th</option> <option value="4">5th-6th</option> <option value="5">7th-8th</option> <option value="6">9th</option> <option value="7">Assoc-acdm</option> <option value="8">Assoc-voc</option> <option value="9">Bachelors</option> <option value="10">Doctorate</option> <option value="11">HS-grad</option> <option value="12">Masters</option> <option value="13">Preschool</option> <option value="14">Prof-school</option> <option value="15">16 – ..

Read more

I have a very strange problem with an AJAX request. The server app.py #### app.py from flask import Flask, request, render_template app = Flask(__name__) app.debug = True @app.route("/myajax", methods=[‘GET’, ‘POST’]) def mypostajaxreq(): print(request.form) if request.method == "POST": name = request.form["name"] return " Hello " + name else: return "Just Hello" @app.route("/") def index(): return render_template("indexlistener.html") ..

Read more

I created a Select Field, so that when user clicks the options , it will send it to its respective page using location.href in js. <select onchange="filter_category(this)" id="category"> <option value="0">All</option> {% for cat in catg %} <option value={{cat.id}}>{{cat.name}} </option> {% endfor %} </select> Javascript: <script> function filter_category(elem){ alert(elem) location.href="/market?id="+elem.selectedIndex + "&category=" + elem.selectedOptions[0].innerText } </script> ..

Read more