Category : flask

I’m trying to redirect to another page but Flask isn’t redirecting return redirect(url_for(‘eventCreated’, eid=event.eid)) The function: @app.route(‘/eventCreated/<eid>’, methods=[‘POST, ‘GET’] def eventCreated(eid): if request.method == ‘GET’: specific_event = classes.FunctionEvents.from_db(eid) code = specific_event.code return render_template(“EventCreated.html”, event_code=code) The Python rum terminal says: “GET /eventCreated/0 HTTP/1.1“ 200 – However I am not redirected to the new page. Any help ..

Read more

I have a Python application which runs without issue locally through vscode and using flask run. When I try the following command to push the application to Azure, it fails: (.venv) C:MOS>az webapp up –sku B1 –name mechanics-of-search-api –location "North Europe" -g "mechanics-of-search" The webapp ‘mechanics-of-search-api’ doesn’t exist Creating AppServicePlan ‘michaelryan998_asp_Linux_northeurope_0’ … Creating webapp ‘mechanics-of-search-api’ ..

Read more

need to transfer the list from one api function to another @app.route(‘/get_output’,methods = [‘GET’,’POST’]) def input_function(): list=[‘1′,’2′,’3′,’4′] status=’success’ length=4 return (jsonify({‘list’:list,’status’:status,’length’})) @app.route(‘/get_part’,methods=[‘GET’] def part_function(): "" I need list to be get print here from the above function"" Source: Python..

Read more

I’m trying to run pgadmin4 on my raspberry pi 4 and when I type this command: sudo python3 ~/pgadmin4/lib/python3.7/site-packages/pgadmin4/pgAdmin4.py I get the following error: ModuleNotFoundError: No module named ‘flask_babelex’ even though when I go to /pgadmin4/lib/python3.7/site-packages I have both flask_babel and flask_babelex and if I try pip install flask-babelex I get: Looking in indexes: https://pypi.org/simple, ..

Read more