skip to Main Content

How to print nested JSON data using Python?

I just started programming. I'm trying to print some nested JSON data using a Python script. Here's an example of the JSON: { "objects": [ { "id": "1", "spec_version": "2.1", "type": "green", "extensions": { "extension-definition--ea279b3e-5c71-4632-ac08-831c66a786ba": { "extension_type": "purple", "id": "2",…

VIEW QUESTION

Json – Get request data from the front end to flask is handled perfectly fine at the local host but not in the server

I am using this code to send data to the front end and then redirect it to another function. @app.route('/get_destination_data', methods=['GET', 'POST']) def get_destination_data(): data = request.get_json() return jsonify({'redirect': url_for("show_destination_info", city_info=data)}) @app.route('/show_destination_info/<city_info>', methods=['GET', 'POST']) def show_destination_info(city_info): return render_template('city-info.html', data=eval(city_info), lists=UserLists.query.filter_by(user_id=current_user.id).all())…

VIEW QUESTION
Back To Top
Search