From 06a889e2e4df1bf4878ffac811b6b4f705027722 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Milivojevi=C4=87?= Date: Tue, 1 Nov 2022 19:20:51 +0100 Subject: [PATCH 1/5] fixes from linear issue --- .../05_flask_smorest/09_decorating_responses/end/schemas.py | 2 +- .../09_delete_models_sqlalchemy/end/models/__init__.py | 3 --- .../09_delete_models_sqlalchemy/end/requirements.txt | 1 + 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/docs/05_flask_smorest/09_decorating_responses/end/schemas.py b/docs/docs/05_flask_smorest/09_decorating_responses/end/schemas.py index 0a4ff8d4..b809ed37 100644 --- a/docs/docs/05_flask_smorest/09_decorating_responses/end/schemas.py +++ b/docs/docs/05_flask_smorest/09_decorating_responses/end/schemas.py @@ -5,7 +5,7 @@ class ItemSchema(Schema): id = fields.Str(dump_only=True) name = fields.Str(required=True) price = fields.Float(required=True) - store_id = fields.Int(required=True) + store_id = fields.Str(required=True) class ItemUpdateSchema(Schema): diff --git a/docs/docs/06_sql_storage_sqlalchemy/09_delete_models_sqlalchemy/end/models/__init__.py b/docs/docs/06_sql_storage_sqlalchemy/09_delete_models_sqlalchemy/end/models/__init__.py index b57f3f8a..7cab8b1b 100644 --- a/docs/docs/06_sql_storage_sqlalchemy/09_delete_models_sqlalchemy/end/models/__init__.py +++ b/docs/docs/06_sql_storage_sqlalchemy/09_delete_models_sqlalchemy/end/models/__init__.py @@ -1,5 +1,2 @@ -from models.user import UserModel from models.item import ItemModel -from models.tag import TagModel from models.store import StoreModel -from models.item_tags import ItemsTags diff --git a/docs/docs/06_sql_storage_sqlalchemy/09_delete_models_sqlalchemy/end/requirements.txt b/docs/docs/06_sql_storage_sqlalchemy/09_delete_models_sqlalchemy/end/requirements.txt index 4764bf34..77fe98e4 100644 --- a/docs/docs/06_sql_storage_sqlalchemy/09_delete_models_sqlalchemy/end/requirements.txt +++ b/docs/docs/06_sql_storage_sqlalchemy/09_delete_models_sqlalchemy/end/requirements.txt @@ -1,4 +1,5 @@ flask flask-smorest +flask-sqlalchemy python-dotenv marshmallow \ No newline at end of file From dcc12d27a0270a8f3a4083be4f05bb724bbf6d48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Milivojevi=C4=87?= Date: Sat, 5 Nov 2022 13:04:05 +0100 Subject: [PATCH 2/5] changed Dockerfiles in sectioon 8 --- .../04_flask_jwt_extended_setup/end/Dockerfile | 3 ++- .../04_flask_jwt_extended_setup/start/Dockerfile | 3 ++- .../05_user_model_and_schema/end/Dockerfile | 3 ++- .../05_user_model_and_schema/start/Dockerfile | 3 ++- .../06_registering_users_rest_api/end/Dockerfile | 3 ++- .../06_registering_users_rest_api/start/Dockerfile | 3 ++- .../07_login_users_rest_api/end/Dockerfile | 3 ++- .../07_login_users_rest_api/start/Dockerfile | 3 ++- .../08_protect_resources_with_jwt_required/end/Dockerfile | 3 ++- .../08_protect_resources_with_jwt_required/start/Dockerfile | 3 ++- .../09_jwt_claims_and_authorization/end/Dockerfile | 3 ++- .../09_jwt_claims_and_authorization/start/Dockerfile | 3 ++- .../10_logout_users_rest_api/end/Dockerfile | 3 ++- .../10_logout_users_rest_api/start/Dockerfile | 3 ++- .../12_token_refreshing_flask_jwt_extended/end/Dockerfile | 3 ++- .../12_token_refreshing_flask_jwt_extended/start/Dockerfile | 3 ++- 16 files changed, 32 insertions(+), 16 deletions(-) diff --git a/docs/docs/08_flask_jwt_extended/04_flask_jwt_extended_setup/end/Dockerfile b/docs/docs/08_flask_jwt_extended/04_flask_jwt_extended_setup/end/Dockerfile index 00c70b5b..652afba1 100644 --- a/docs/docs/08_flask_jwt_extended/04_flask_jwt_extended_setup/end/Dockerfile +++ b/docs/docs/08_flask_jwt_extended/04_flask_jwt_extended_setup/end/Dockerfile @@ -1,6 +1,7 @@ FROM python:3.10 +EXPOSE 5000 WORKDIR /app COPY ./requirements.txt requirements.txt RUN pip install --no-cache-dir --upgrade -r requirements.txt COPY . . -CMD ["gunicorn", "--bind", "0.0.0.0:80", "app:create_app()"] \ No newline at end of file +CMD ["flask", "run", "--host", "0.0.0.0"] \ No newline at end of file diff --git a/docs/docs/08_flask_jwt_extended/04_flask_jwt_extended_setup/start/Dockerfile b/docs/docs/08_flask_jwt_extended/04_flask_jwt_extended_setup/start/Dockerfile index 00c70b5b..652afba1 100644 --- a/docs/docs/08_flask_jwt_extended/04_flask_jwt_extended_setup/start/Dockerfile +++ b/docs/docs/08_flask_jwt_extended/04_flask_jwt_extended_setup/start/Dockerfile @@ -1,6 +1,7 @@ FROM python:3.10 +EXPOSE 5000 WORKDIR /app COPY ./requirements.txt requirements.txt RUN pip install --no-cache-dir --upgrade -r requirements.txt COPY . . -CMD ["gunicorn", "--bind", "0.0.0.0:80", "app:create_app()"] \ No newline at end of file +CMD ["flask", "run", "--host", "0.0.0.0"] \ No newline at end of file diff --git a/docs/docs/08_flask_jwt_extended/05_user_model_and_schema/end/Dockerfile b/docs/docs/08_flask_jwt_extended/05_user_model_and_schema/end/Dockerfile index 00c70b5b..652afba1 100644 --- a/docs/docs/08_flask_jwt_extended/05_user_model_and_schema/end/Dockerfile +++ b/docs/docs/08_flask_jwt_extended/05_user_model_and_schema/end/Dockerfile @@ -1,6 +1,7 @@ FROM python:3.10 +EXPOSE 5000 WORKDIR /app COPY ./requirements.txt requirements.txt RUN pip install --no-cache-dir --upgrade -r requirements.txt COPY . . -CMD ["gunicorn", "--bind", "0.0.0.0:80", "app:create_app()"] \ No newline at end of file +CMD ["flask", "run", "--host", "0.0.0.0"] \ No newline at end of file diff --git a/docs/docs/08_flask_jwt_extended/05_user_model_and_schema/start/Dockerfile b/docs/docs/08_flask_jwt_extended/05_user_model_and_schema/start/Dockerfile index 00c70b5b..652afba1 100644 --- a/docs/docs/08_flask_jwt_extended/05_user_model_and_schema/start/Dockerfile +++ b/docs/docs/08_flask_jwt_extended/05_user_model_and_schema/start/Dockerfile @@ -1,6 +1,7 @@ FROM python:3.10 +EXPOSE 5000 WORKDIR /app COPY ./requirements.txt requirements.txt RUN pip install --no-cache-dir --upgrade -r requirements.txt COPY . . -CMD ["gunicorn", "--bind", "0.0.0.0:80", "app:create_app()"] \ No newline at end of file +CMD ["flask", "run", "--host", "0.0.0.0"] \ No newline at end of file diff --git a/docs/docs/08_flask_jwt_extended/06_registering_users_rest_api/end/Dockerfile b/docs/docs/08_flask_jwt_extended/06_registering_users_rest_api/end/Dockerfile index 00c70b5b..652afba1 100644 --- a/docs/docs/08_flask_jwt_extended/06_registering_users_rest_api/end/Dockerfile +++ b/docs/docs/08_flask_jwt_extended/06_registering_users_rest_api/end/Dockerfile @@ -1,6 +1,7 @@ FROM python:3.10 +EXPOSE 5000 WORKDIR /app COPY ./requirements.txt requirements.txt RUN pip install --no-cache-dir --upgrade -r requirements.txt COPY . . -CMD ["gunicorn", "--bind", "0.0.0.0:80", "app:create_app()"] \ No newline at end of file +CMD ["flask", "run", "--host", "0.0.0.0"] \ No newline at end of file diff --git a/docs/docs/08_flask_jwt_extended/06_registering_users_rest_api/start/Dockerfile b/docs/docs/08_flask_jwt_extended/06_registering_users_rest_api/start/Dockerfile index 00c70b5b..652afba1 100644 --- a/docs/docs/08_flask_jwt_extended/06_registering_users_rest_api/start/Dockerfile +++ b/docs/docs/08_flask_jwt_extended/06_registering_users_rest_api/start/Dockerfile @@ -1,6 +1,7 @@ FROM python:3.10 +EXPOSE 5000 WORKDIR /app COPY ./requirements.txt requirements.txt RUN pip install --no-cache-dir --upgrade -r requirements.txt COPY . . -CMD ["gunicorn", "--bind", "0.0.0.0:80", "app:create_app()"] \ No newline at end of file +CMD ["flask", "run", "--host", "0.0.0.0"] \ No newline at end of file diff --git a/docs/docs/08_flask_jwt_extended/07_login_users_rest_api/end/Dockerfile b/docs/docs/08_flask_jwt_extended/07_login_users_rest_api/end/Dockerfile index 00c70b5b..652afba1 100644 --- a/docs/docs/08_flask_jwt_extended/07_login_users_rest_api/end/Dockerfile +++ b/docs/docs/08_flask_jwt_extended/07_login_users_rest_api/end/Dockerfile @@ -1,6 +1,7 @@ FROM python:3.10 +EXPOSE 5000 WORKDIR /app COPY ./requirements.txt requirements.txt RUN pip install --no-cache-dir --upgrade -r requirements.txt COPY . . -CMD ["gunicorn", "--bind", "0.0.0.0:80", "app:create_app()"] \ No newline at end of file +CMD ["flask", "run", "--host", "0.0.0.0"] \ No newline at end of file diff --git a/docs/docs/08_flask_jwt_extended/07_login_users_rest_api/start/Dockerfile b/docs/docs/08_flask_jwt_extended/07_login_users_rest_api/start/Dockerfile index 00c70b5b..652afba1 100644 --- a/docs/docs/08_flask_jwt_extended/07_login_users_rest_api/start/Dockerfile +++ b/docs/docs/08_flask_jwt_extended/07_login_users_rest_api/start/Dockerfile @@ -1,6 +1,7 @@ FROM python:3.10 +EXPOSE 5000 WORKDIR /app COPY ./requirements.txt requirements.txt RUN pip install --no-cache-dir --upgrade -r requirements.txt COPY . . -CMD ["gunicorn", "--bind", "0.0.0.0:80", "app:create_app()"] \ No newline at end of file +CMD ["flask", "run", "--host", "0.0.0.0"] \ No newline at end of file diff --git a/docs/docs/08_flask_jwt_extended/08_protect_resources_with_jwt_required/end/Dockerfile b/docs/docs/08_flask_jwt_extended/08_protect_resources_with_jwt_required/end/Dockerfile index 00c70b5b..652afba1 100644 --- a/docs/docs/08_flask_jwt_extended/08_protect_resources_with_jwt_required/end/Dockerfile +++ b/docs/docs/08_flask_jwt_extended/08_protect_resources_with_jwt_required/end/Dockerfile @@ -1,6 +1,7 @@ FROM python:3.10 +EXPOSE 5000 WORKDIR /app COPY ./requirements.txt requirements.txt RUN pip install --no-cache-dir --upgrade -r requirements.txt COPY . . -CMD ["gunicorn", "--bind", "0.0.0.0:80", "app:create_app()"] \ No newline at end of file +CMD ["flask", "run", "--host", "0.0.0.0"] \ No newline at end of file diff --git a/docs/docs/08_flask_jwt_extended/08_protect_resources_with_jwt_required/start/Dockerfile b/docs/docs/08_flask_jwt_extended/08_protect_resources_with_jwt_required/start/Dockerfile index 00c70b5b..652afba1 100644 --- a/docs/docs/08_flask_jwt_extended/08_protect_resources_with_jwt_required/start/Dockerfile +++ b/docs/docs/08_flask_jwt_extended/08_protect_resources_with_jwt_required/start/Dockerfile @@ -1,6 +1,7 @@ FROM python:3.10 +EXPOSE 5000 WORKDIR /app COPY ./requirements.txt requirements.txt RUN pip install --no-cache-dir --upgrade -r requirements.txt COPY . . -CMD ["gunicorn", "--bind", "0.0.0.0:80", "app:create_app()"] \ No newline at end of file +CMD ["flask", "run", "--host", "0.0.0.0"] \ No newline at end of file diff --git a/docs/docs/08_flask_jwt_extended/09_jwt_claims_and_authorization/end/Dockerfile b/docs/docs/08_flask_jwt_extended/09_jwt_claims_and_authorization/end/Dockerfile index 00c70b5b..652afba1 100644 --- a/docs/docs/08_flask_jwt_extended/09_jwt_claims_and_authorization/end/Dockerfile +++ b/docs/docs/08_flask_jwt_extended/09_jwt_claims_and_authorization/end/Dockerfile @@ -1,6 +1,7 @@ FROM python:3.10 +EXPOSE 5000 WORKDIR /app COPY ./requirements.txt requirements.txt RUN pip install --no-cache-dir --upgrade -r requirements.txt COPY . . -CMD ["gunicorn", "--bind", "0.0.0.0:80", "app:create_app()"] \ No newline at end of file +CMD ["flask", "run", "--host", "0.0.0.0"] \ No newline at end of file diff --git a/docs/docs/08_flask_jwt_extended/09_jwt_claims_and_authorization/start/Dockerfile b/docs/docs/08_flask_jwt_extended/09_jwt_claims_and_authorization/start/Dockerfile index 00c70b5b..652afba1 100644 --- a/docs/docs/08_flask_jwt_extended/09_jwt_claims_and_authorization/start/Dockerfile +++ b/docs/docs/08_flask_jwt_extended/09_jwt_claims_and_authorization/start/Dockerfile @@ -1,6 +1,7 @@ FROM python:3.10 +EXPOSE 5000 WORKDIR /app COPY ./requirements.txt requirements.txt RUN pip install --no-cache-dir --upgrade -r requirements.txt COPY . . -CMD ["gunicorn", "--bind", "0.0.0.0:80", "app:create_app()"] \ No newline at end of file +CMD ["flask", "run", "--host", "0.0.0.0"] \ No newline at end of file diff --git a/docs/docs/08_flask_jwt_extended/10_logout_users_rest_api/end/Dockerfile b/docs/docs/08_flask_jwt_extended/10_logout_users_rest_api/end/Dockerfile index 00c70b5b..652afba1 100644 --- a/docs/docs/08_flask_jwt_extended/10_logout_users_rest_api/end/Dockerfile +++ b/docs/docs/08_flask_jwt_extended/10_logout_users_rest_api/end/Dockerfile @@ -1,6 +1,7 @@ FROM python:3.10 +EXPOSE 5000 WORKDIR /app COPY ./requirements.txt requirements.txt RUN pip install --no-cache-dir --upgrade -r requirements.txt COPY . . -CMD ["gunicorn", "--bind", "0.0.0.0:80", "app:create_app()"] \ No newline at end of file +CMD ["flask", "run", "--host", "0.0.0.0"] \ No newline at end of file diff --git a/docs/docs/08_flask_jwt_extended/10_logout_users_rest_api/start/Dockerfile b/docs/docs/08_flask_jwt_extended/10_logout_users_rest_api/start/Dockerfile index 00c70b5b..652afba1 100644 --- a/docs/docs/08_flask_jwt_extended/10_logout_users_rest_api/start/Dockerfile +++ b/docs/docs/08_flask_jwt_extended/10_logout_users_rest_api/start/Dockerfile @@ -1,6 +1,7 @@ FROM python:3.10 +EXPOSE 5000 WORKDIR /app COPY ./requirements.txt requirements.txt RUN pip install --no-cache-dir --upgrade -r requirements.txt COPY . . -CMD ["gunicorn", "--bind", "0.0.0.0:80", "app:create_app()"] \ No newline at end of file +CMD ["flask", "run", "--host", "0.0.0.0"] \ No newline at end of file diff --git a/docs/docs/08_flask_jwt_extended/12_token_refreshing_flask_jwt_extended/end/Dockerfile b/docs/docs/08_flask_jwt_extended/12_token_refreshing_flask_jwt_extended/end/Dockerfile index 00c70b5b..652afba1 100644 --- a/docs/docs/08_flask_jwt_extended/12_token_refreshing_flask_jwt_extended/end/Dockerfile +++ b/docs/docs/08_flask_jwt_extended/12_token_refreshing_flask_jwt_extended/end/Dockerfile @@ -1,6 +1,7 @@ FROM python:3.10 +EXPOSE 5000 WORKDIR /app COPY ./requirements.txt requirements.txt RUN pip install --no-cache-dir --upgrade -r requirements.txt COPY . . -CMD ["gunicorn", "--bind", "0.0.0.0:80", "app:create_app()"] \ No newline at end of file +CMD ["flask", "run", "--host", "0.0.0.0"] \ No newline at end of file diff --git a/docs/docs/08_flask_jwt_extended/12_token_refreshing_flask_jwt_extended/start/Dockerfile b/docs/docs/08_flask_jwt_extended/12_token_refreshing_flask_jwt_extended/start/Dockerfile index 00c70b5b..652afba1 100644 --- a/docs/docs/08_flask_jwt_extended/12_token_refreshing_flask_jwt_extended/start/Dockerfile +++ b/docs/docs/08_flask_jwt_extended/12_token_refreshing_flask_jwt_extended/start/Dockerfile @@ -1,6 +1,7 @@ FROM python:3.10 +EXPOSE 5000 WORKDIR /app COPY ./requirements.txt requirements.txt RUN pip install --no-cache-dir --upgrade -r requirements.txt COPY . . -CMD ["gunicorn", "--bind", "0.0.0.0:80", "app:create_app()"] \ No newline at end of file +CMD ["flask", "run", "--host", "0.0.0.0"] \ No newline at end of file From 56b6e71d36e13abe7ff92096274bf31dbc09278a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Milivojevi=C4=87?= Date: Sat, 5 Nov 2022 13:13:39 +0100 Subject: [PATCH 3/5] fixed schema in e-book --- docs/docs/05_flask_smorest/07_marshmallow_schemas/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/05_flask_smorest/07_marshmallow_schemas/README.md b/docs/docs/05_flask_smorest/07_marshmallow_schemas/README.md index 5a802257..02b73e64 100644 --- a/docs/docs/05_flask_smorest/07_marshmallow_schemas/README.md +++ b/docs/docs/05_flask_smorest/07_marshmallow_schemas/README.md @@ -37,7 +37,7 @@ class ItemSchema(Schema): id = fields.Str(dump_only=True) name = fields.Str(required=True) price = fields.Float(required=True) - store_id = fields.Int(required=True) + store_id = fields.Str(required=True) ``` A couple of weird things maybe! From d6961c3345dfe9dbefc88dabc5098884be249fe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Milivojevi=C4=87?= Date: Sun, 6 Nov 2022 21:06:58 +0100 Subject: [PATCH 4/5] fixed schemas --- .../docs/05_flask_smorest/07_marshmallow_schemas/end/schemas.py | 2 +- .../08_validation_with_marshmallow/end/schemas.py | 2 +- .../08_validation_with_marshmallow/start/schemas.py | 2 +- .../05_flask_smorest/09_decorating_responses/start/schemas.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/docs/05_flask_smorest/07_marshmallow_schemas/end/schemas.py b/docs/docs/05_flask_smorest/07_marshmallow_schemas/end/schemas.py index 0a4ff8d4..b809ed37 100644 --- a/docs/docs/05_flask_smorest/07_marshmallow_schemas/end/schemas.py +++ b/docs/docs/05_flask_smorest/07_marshmallow_schemas/end/schemas.py @@ -5,7 +5,7 @@ class ItemSchema(Schema): id = fields.Str(dump_only=True) name = fields.Str(required=True) price = fields.Float(required=True) - store_id = fields.Int(required=True) + store_id = fields.Str(required=True) class ItemUpdateSchema(Schema): diff --git a/docs/docs/05_flask_smorest/08_validation_with_marshmallow/end/schemas.py b/docs/docs/05_flask_smorest/08_validation_with_marshmallow/end/schemas.py index 0a4ff8d4..b809ed37 100644 --- a/docs/docs/05_flask_smorest/08_validation_with_marshmallow/end/schemas.py +++ b/docs/docs/05_flask_smorest/08_validation_with_marshmallow/end/schemas.py @@ -5,7 +5,7 @@ class ItemSchema(Schema): id = fields.Str(dump_only=True) name = fields.Str(required=True) price = fields.Float(required=True) - store_id = fields.Int(required=True) + store_id = fields.Str(required=True) class ItemUpdateSchema(Schema): diff --git a/docs/docs/05_flask_smorest/08_validation_with_marshmallow/start/schemas.py b/docs/docs/05_flask_smorest/08_validation_with_marshmallow/start/schemas.py index 0a4ff8d4..b809ed37 100644 --- a/docs/docs/05_flask_smorest/08_validation_with_marshmallow/start/schemas.py +++ b/docs/docs/05_flask_smorest/08_validation_with_marshmallow/start/schemas.py @@ -5,7 +5,7 @@ class ItemSchema(Schema): id = fields.Str(dump_only=True) name = fields.Str(required=True) price = fields.Float(required=True) - store_id = fields.Int(required=True) + store_id = fields.Str(required=True) class ItemUpdateSchema(Schema): diff --git a/docs/docs/05_flask_smorest/09_decorating_responses/start/schemas.py b/docs/docs/05_flask_smorest/09_decorating_responses/start/schemas.py index 0a4ff8d4..b809ed37 100644 --- a/docs/docs/05_flask_smorest/09_decorating_responses/start/schemas.py +++ b/docs/docs/05_flask_smorest/09_decorating_responses/start/schemas.py @@ -5,7 +5,7 @@ class ItemSchema(Schema): id = fields.Str(dump_only=True) name = fields.Str(required=True) price = fields.Float(required=True) - store_id = fields.Int(required=True) + store_id = fields.Str(required=True) class ItemUpdateSchema(Schema): From 0ce7a5d0ba39176df8dd045912c7a5664614284b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Milivojevi=C4=87?= Date: Sun, 6 Nov 2022 21:10:26 +0100 Subject: [PATCH 5/5] fixed schema --- .../02_create_simple_sqlalchemy_model/start/schemas.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/06_sql_storage_sqlalchemy/02_create_simple_sqlalchemy_model/start/schemas.py b/docs/docs/06_sql_storage_sqlalchemy/02_create_simple_sqlalchemy_model/start/schemas.py index 0a4ff8d4..b809ed37 100644 --- a/docs/docs/06_sql_storage_sqlalchemy/02_create_simple_sqlalchemy_model/start/schemas.py +++ b/docs/docs/06_sql_storage_sqlalchemy/02_create_simple_sqlalchemy_model/start/schemas.py @@ -5,7 +5,7 @@ class ItemSchema(Schema): id = fields.Str(dump_only=True) name = fields.Str(required=True) price = fields.Float(required=True) - store_id = fields.Int(required=True) + store_id = fields.Str(required=True) class ItemUpdateSchema(Schema):