From 62f9984e6915087849fe8107c27a59eafcf6db4e Mon Sep 17 00:00:00 2001 From: TocaSoft Date: Fri, 11 Nov 2022 22:14:16 -0500 Subject: [PATCH 01/19] Update app.py --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index d82c51f0d..fd65a7e18 100644 --- a/app.py +++ b/app.py @@ -3,4 +3,4 @@ @app.route('/') def hello_world(): - return 'Hello, World!' + return 'Hello, ok World!' From d779c7d1dfc2a96dbfe95d82af18edaf3210da1e Mon Sep 17 00:00:00 2001 From: TocaSoft Date: Sun, 21 Apr 2024 11:26:18 -0400 Subject: [PATCH 02/19] hi --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index fd65a7e18..fe65f819b 100644 --- a/app.py +++ b/app.py @@ -3,4 +3,4 @@ @app.route('/') def hello_world(): - return 'Hello, ok World!' + return 'Hello, ok World!ok' From a1dcd2064e668c28f80299a3d43cd5bfa5ce3f3f Mon Sep 17 00:00:00 2001 From: TocaSoft Date: Tue, 4 Jun 2024 16:31:38 -0400 Subject: [PATCH 03/19] modified: app.py --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index fe65f819b..8d3f7b60e 100644 --- a/app.py +++ b/app.py @@ -3,4 +3,4 @@ @app.route('/') def hello_world(): - return 'Hello, ok World!ok' + return 'Hello, ok Cuba !ok' From e2f7394b3f3374824a86f842573e15c3f5126a77 Mon Sep 17 00:00:00 2001 From: TocaSoft Date: Tue, 4 Jun 2024 16:41:29 -0400 Subject: [PATCH 04/19] modified: app.py --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index 8d3f7b60e..4e5ce6dcc 100644 --- a/app.py +++ b/app.py @@ -3,4 +3,4 @@ @app.route('/') def hello_world(): - return 'Hello, ok Cuba !ok' + return 'Hello, ok Viva Cuba !ok' From c577c92ee54d233ba952f0f1d092e9d12637adce Mon Sep 17 00:00:00 2001 From: TocaSoft Date: Tue, 4 Jun 2024 16:49:31 -0400 Subject: [PATCH 05/19] modified: app.py --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index 4e5ce6dcc..f200f23d6 100644 --- a/app.py +++ b/app.py @@ -3,4 +3,4 @@ @app.route('/') def hello_world(): - return 'Hello, ok Viva Cuba !ok' + return 'Hello, ok Viva Cuba Libre Joseito!ok' From cf45f332e5dc0de2fc80c8ace7e70c504907cac7 Mon Sep 17 00:00:00 2001 From: TocaSoft Date: Tue, 4 Jun 2024 17:03:31 -0400 Subject: [PATCH 06/19] modified: app.py --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index f200f23d6..a21849c43 100644 --- a/app.py +++ b/app.py @@ -3,4 +3,4 @@ @app.route('/') def hello_world(): - return 'Hello, ok Viva Cuba Libre Joseito!ok' + return 'Hello, ok Viva Cuba Libre Joseito a!ok' From 1ee7523070c66fbb7ef8b94c7bc3149ffd850a8c Mon Sep 17 00:00:00 2001 From: TocaSoft Date: Tue, 4 Jun 2024 18:22:53 -0400 Subject: [PATCH 07/19] new file: example2.json new file: stactic/example2.json --- example2.json | 125 ++++++++++++++++++++++++++++++++++++++++++ stactic/example2.json | 125 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 250 insertions(+) create mode 100644 example2.json create mode 100644 stactic/example2.json diff --git a/example2.json b/example2.json new file mode 100644 index 000000000..ee7986442 --- /dev/null +++ b/example2.json @@ -0,0 +1,125 @@ +{ + "locales": [ + { + "id": 1, + "nombre_local": "Local name", + "pantallas": [ + { + "nombre_pantalla": "Screen 1", + "productos": [ + { + "nombre_producto": "Producto 1", + "precio": "888888888888" + }, + { + "nombre_producto": "Producto 2", + "precio": "888888888" + }, + { + "nombre_producto": "Producto 3", + "precio": "8888888888" + } + ] + }, + { + "nombre_pantalla": "Screen 2", + "productos": [ + { + "nombre_producto": "Producto 4", + "precio": "1" + }, + { + "nombre_producto": "Producto 5", + "precio": "33" + }, + { + "nombre_producto": "Producto 6", + "precio": "1111111111111111111111111111111111" + } + ] + }, + { + "nombre_pantalla": "Screen 3", + "productos": [ + { + "nombre_producto": "Producto 7", + "precio": "56" + }, + { + "nombre_producto": "Producto 8", + "precio": "50" + } + ] + }, + { + "nombre_pantalla": "Screen 4", + "productos": [ + { + "nombre_producto": "Producto 9", + "precio": "60" + }, + { + "nombre_producto": "Producto 10", + "precio": "35" + } + ] + } + ] + }, + { + "id": 2, + "nombre_local": "Another local name", + "pantallas": [ + { + "nombre_pantalla": "Screen A", + "productos": [] + }, + { + "nombre_pantalla": "Screen B", + "productos": [] + }, + { + "nombre_pantalla": "Screen C", + "productos": [ + { + "nombre_producto": "Producto 11", + "precio": 49.99 + }, + { + "nombre_producto": "Producto 12", + "precio": 39.99 + } + ] + }, + { + "nombre_pantalla": "Screen D", + "productos": [ + { + "nombre_producto": "Producto 13", + "precio": 24.99 + }, + { + "nombre_producto": "Producto 14", + "precio": 14.99 + } + ] + } + ] + }, + { + "id": 3, + "nombre_local": "Caribbean", + "pantallas": [] + }, + { + "id": 4, + "nombre_local": "Caribbean", + "pantallas": [] + }, + { + "id": 5, + "nombre_local": "Caribbean 2", + "pantallas": [] + } + ] +} \ No newline at end of file diff --git a/stactic/example2.json b/stactic/example2.json new file mode 100644 index 000000000..ee7986442 --- /dev/null +++ b/stactic/example2.json @@ -0,0 +1,125 @@ +{ + "locales": [ + { + "id": 1, + "nombre_local": "Local name", + "pantallas": [ + { + "nombre_pantalla": "Screen 1", + "productos": [ + { + "nombre_producto": "Producto 1", + "precio": "888888888888" + }, + { + "nombre_producto": "Producto 2", + "precio": "888888888" + }, + { + "nombre_producto": "Producto 3", + "precio": "8888888888" + } + ] + }, + { + "nombre_pantalla": "Screen 2", + "productos": [ + { + "nombre_producto": "Producto 4", + "precio": "1" + }, + { + "nombre_producto": "Producto 5", + "precio": "33" + }, + { + "nombre_producto": "Producto 6", + "precio": "1111111111111111111111111111111111" + } + ] + }, + { + "nombre_pantalla": "Screen 3", + "productos": [ + { + "nombre_producto": "Producto 7", + "precio": "56" + }, + { + "nombre_producto": "Producto 8", + "precio": "50" + } + ] + }, + { + "nombre_pantalla": "Screen 4", + "productos": [ + { + "nombre_producto": "Producto 9", + "precio": "60" + }, + { + "nombre_producto": "Producto 10", + "precio": "35" + } + ] + } + ] + }, + { + "id": 2, + "nombre_local": "Another local name", + "pantallas": [ + { + "nombre_pantalla": "Screen A", + "productos": [] + }, + { + "nombre_pantalla": "Screen B", + "productos": [] + }, + { + "nombre_pantalla": "Screen C", + "productos": [ + { + "nombre_producto": "Producto 11", + "precio": 49.99 + }, + { + "nombre_producto": "Producto 12", + "precio": 39.99 + } + ] + }, + { + "nombre_pantalla": "Screen D", + "productos": [ + { + "nombre_producto": "Producto 13", + "precio": 24.99 + }, + { + "nombre_producto": "Producto 14", + "precio": 14.99 + } + ] + } + ] + }, + { + "id": 3, + "nombre_local": "Caribbean", + "pantallas": [] + }, + { + "id": 4, + "nombre_local": "Caribbean", + "pantallas": [] + }, + { + "id": 5, + "nombre_local": "Caribbean 2", + "pantallas": [] + } + ] +} \ No newline at end of file From 525a768eaf1cd86e30bd6b6adf4cf497fdfdb8ea Mon Sep 17 00:00:00 2001 From: TocaSoft Date: Tue, 4 Jun 2024 18:44:21 -0400 Subject: [PATCH 08/19] new file: stactic/hello.html --- stactic/hello.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 stactic/hello.html diff --git a/stactic/hello.html b/stactic/hello.html new file mode 100644 index 000000000..b6fc4c620 --- /dev/null +++ b/stactic/hello.html @@ -0,0 +1 @@ +hello \ No newline at end of file From 4c4e47e14a8af424fd9869a7de199d94fdd722e6 Mon Sep 17 00:00:00 2001 From: TocaSoft Date: Tue, 4 Jun 2024 21:58:05 -0400 Subject: [PATCH 09/19] modified: app.py modified: requirements.txt --- app.py | 18 +++++++++++++++--- requirements.txt | 2 ++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index a21849c43..9f67b0176 100644 --- a/app.py +++ b/app.py @@ -1,6 +1,18 @@ -from flask import Flask +from flask import Flask, jsonify, send_from_directory + app = Flask(__name__) +# Ruta para devolver el JSON +@app.route('/get_json') +def get_json(): + data = { + "key1": "value1", + "key2": "value2" + } + return jsonify(data) + +# Ruta para servir un fichero JSON estático @app.route('/') -def hello_world(): - return 'Hello, ok Viva Cuba Libre Joseito a!ok' +def index(): + return send_from_directory('static', 'example2.json') + diff --git a/requirements.txt b/requirements.txt index 147ddd086..b7486b226 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,4 @@ Flask Gunicorn +jsonify +send_from_directory \ No newline at end of file From 05b0b72cfa31a427f81304b3389962fe0ee56163 Mon Sep 17 00:00:00 2001 From: TocaSoft Date: Tue, 4 Jun 2024 22:14:09 -0400 Subject: [PATCH 10/19] modified: app.py modified: requirements.txt --- app.py | 7 +++++-- requirements.txt | 2 -- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app.py b/app.py index 9f67b0176..a530cea1e 100644 --- a/app.py +++ b/app.py @@ -13,6 +13,9 @@ def get_json(): # Ruta para servir un fichero JSON estático @app.route('/') -def index(): - return send_from_directory('static', 'example2.json') +def index(): + def index(): + with open('./stactic/example2.json', 'r') as f: + data = json.load(f) + return jsonify(data) diff --git a/requirements.txt b/requirements.txt index b7486b226..147ddd086 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,2 @@ Flask Gunicorn -jsonify -send_from_directory \ No newline at end of file From ea55ef98f3f03b621149c70c344396873b1bd51b Mon Sep 17 00:00:00 2001 From: TocaSoft Date: Tue, 4 Jun 2024 22:23:49 -0400 Subject: [PATCH 11/19] modified: app.py --- app.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app.py b/app.py index a530cea1e..2726c2085 100644 --- a/app.py +++ b/app.py @@ -13,9 +13,9 @@ def get_json(): # Ruta para servir un fichero JSON estático @app.route('/') -def index(): - def index(): - with open('./stactic/example2.json', 'r') as f: - data = json.load(f) - return jsonify(data) + +def index(): + with open('./stactic/example2.json', 'r') as f: + data = json.load(f) + return jsonify(data) From 714fd6ddc00a74682099f9bdfc6fb11e48aa49a4 Mon Sep 17 00:00:00 2001 From: TocaSoft Date: Tue, 4 Jun 2024 22:30:44 -0400 Subject: [PATCH 12/19] modified: app.py modified: requirements.txt --- app.py | 8 ++++---- requirements.txt | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app.py b/app.py index 2726c2085..fb62e594a 100644 --- a/app.py +++ b/app.py @@ -1,4 +1,5 @@ from flask import Flask, jsonify, send_from_directory +import json app = Flask(__name__) @@ -11,11 +12,10 @@ def get_json(): } return jsonify(data) -# Ruta para servir un fichero JSON estático @app.route('/') - def index(): - with open('./stactic/example2.json', 'r') as f: - data = json.load(f) + with open('./stactic/example2.json', 'r') as f: + data = json.load(f) + return jsonify(data) return jsonify(data) diff --git a/requirements.txt b/requirements.txt index 147ddd086..d41312c04 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ Flask Gunicorn +json \ No newline at end of file From 8568fc9fbea5d4d3c04a863463975fa00e04cd6e Mon Sep 17 00:00:00 2001 From: TocaSoft Date: Tue, 4 Jun 2024 22:45:27 -0400 Subject: [PATCH 13/19] modified: app.py --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index fb62e594a..7a0df7367 100644 --- a/app.py +++ b/app.py @@ -17,5 +17,5 @@ def index(): with open('./stactic/example2.json', 'r') as f: data = json.load(f) return jsonify(data) - return jsonify(data) + From 0b6eea9f983107ffd5424e92d0f4512373bf3d30 Mon Sep 17 00:00:00 2001 From: TocaSoft Date: Tue, 4 Jun 2024 22:53:27 -0400 Subject: [PATCH 14/19] modified: app.py --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index 7a0df7367..699db1abd 100644 --- a/app.py +++ b/app.py @@ -1,4 +1,4 @@ -from flask import Flask, jsonify, send_from_directory +from flask import Flask, jsonify import json app = Flask(__name__) From 65d5e29871b71affdabd82b6918c833b3e5231e3 Mon Sep 17 00:00:00 2001 From: TocaSoft Date: Tue, 4 Jun 2024 23:03:13 -0400 Subject: [PATCH 15/19] modified: app.py --- app.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index 699db1abd..73d515309 100644 --- a/app.py +++ b/app.py @@ -12,10 +12,12 @@ def get_json(): } return jsonify(data) -@app.route('/') +@app.route('/', methods=['GET']) def index(): - with open('./stactic/example2.json', 'r') as f: + with open('./static/example2.json', 'r') as f: data = json.load(f) return jsonify(data) + + From 98e82ad0b04e623e997da27893d93be52cf46a76 Mon Sep 17 00:00:00 2001 From: TocaSoft Date: Tue, 4 Jun 2024 23:16:30 -0400 Subject: [PATCH 16/19] modified: app.py modified: requirements.txt --- app.py | 6 +----- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/app.py b/app.py index 73d515309..23de1fe42 100644 --- a/app.py +++ b/app.py @@ -16,8 +16,4 @@ def get_json(): def index(): with open('./static/example2.json', 'r') as f: data = json.load(f) - return jsonify(data) - - - - + return jsonify(data) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index d41312c04..217011cd8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -Flask +flask Gunicorn json \ No newline at end of file From e2c183d8ba9c6b35895773a4f945ceb0ae3707af Mon Sep 17 00:00:00 2001 From: TocaSoft Date: Tue, 4 Jun 2024 23:56:28 -0400 Subject: [PATCH 17/19] modified: app.py modified: requirements.txt --- app.py | 4 ++-- pip | 0 requirements.txt | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) create mode 100644 pip diff --git a/app.py b/app.py index 23de1fe42..494c02113 100644 --- a/app.py +++ b/app.py @@ -1,5 +1,5 @@ -from flask import Flask, jsonify -import json +from flask import Flask, jsonify,json + app = Flask(__name__) diff --git a/pip b/pip new file mode 100644 index 000000000..e69de29bb diff --git a/requirements.txt b/requirements.txt index 217011cd8..b115eb66f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,2 @@ flask Gunicorn -json \ No newline at end of file From 5c78cef938e185101dbba12c233ad33fec345284 Mon Sep 17 00:00:00 2001 From: TocaSoft Date: Wed, 5 Jun 2024 00:07:45 -0400 Subject: [PATCH 18/19] modified: app.py renamed: stactic/example2.json -> static/example2.json renamed: stactic/hello.html -> static/hello.html --- app.py | 7 +++++-- {stactic => static}/example2.json | 0 {stactic => static}/hello.html | 0 3 files changed, 5 insertions(+), 2 deletions(-) rename {stactic => static}/example2.json (100%) rename {stactic => static}/hello.html (100%) diff --git a/app.py b/app.py index 494c02113..59d13fd85 100644 --- a/app.py +++ b/app.py @@ -14,6 +14,9 @@ def get_json(): @app.route('/', methods=['GET']) def index(): - with open('./static/example2.json', 'r') as f: + with open('static/example2.json', 'r') as f: data = json.load(f) - return jsonify(data) \ No newline at end of file + return jsonify(data) + +if __name__ == "__main__": + app.run() \ No newline at end of file diff --git a/stactic/example2.json b/static/example2.json similarity index 100% rename from stactic/example2.json rename to static/example2.json diff --git a/stactic/hello.html b/static/hello.html similarity index 100% rename from stactic/hello.html rename to static/hello.html From 25ad9502976f24febe9931bac92f33e75fd4b392 Mon Sep 17 00:00:00 2001 From: TocaSoft Date: Wed, 5 Jun 2024 00:08:26 -0400 Subject: [PATCH 19/19] modified: app.py --- app.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/app.py b/app.py index 59d13fd85..d4ab422bd 100644 --- a/app.py +++ b/app.py @@ -18,5 +18,3 @@ def index(): data = json.load(f) return jsonify(data) -if __name__ == "__main__": - app.run() \ No newline at end of file