Deploying flask app on cpanel, INTERNAL SERVER ERROR when changing requesting other than base url

I want to deploy my flask-restx application on a shared hosting. Since I am beginner in deployment, I followed a video tutorial from youtube. I did step by step by following this tutorial. For...

Allow null values in a field in flask-restx / flask-restplus

I am using flask-restx for building an API. My api model is like the following: myModel = api.model( 'myModel', { 'id' : fields.Integer(min=1, required=True), 'code' :...

psycopg2.OperationalError errors

I have created a Python flask web app and deployed it on an Azure App service using gunicorn. The web app uses flask_sqlalchemy to connect to a PostgreSQL database which is also deployed on an...

Flask-restful using nested fields to generate docs with nested response, getting TypeError: Object of type Nested is not JSON serializable

I am using flask-restx / flask-restplus, trying utilize the swagger documentation generation feature. I have this setup for my models. A = api.model( 'A', { "a1":...

How to host flask-restx swagger UI using nginx reverse proxy

I have tried multiple way to fix the reverse proxy, but not getting any luck. I followed the below url to fix the issue: https://github.com/noirbizarre/flask-restplus/issues/223 The nginx config...

SQLAlchemy raises error when inserting Postgres array of enum column

I have created a column which is a Postgres Array of type Enum. When I try to insert data, I get a long traceback, the error message that seems relevant is: psycopg2.errors.DatatypeMismatch:...

Zappa+Flask: A GET request to '/' yielded a 502 response code

I am trying to deploy my flask app on aws lambda via zappa. And I am getting the following error when I do zappa deploy dev: Calling deploy for stage dev.. Downloading and installing...

Flask-Restx(/Flask-Restplus) detect reload

my problem is the following: In my Flask-Restx-Application I created a Runner-Thread which runs asynchronously to the main-thread of the Flask-Application. Now when I do changes as usual the...

Python file runs using python command but not using Flask

I have a small application built using Flask and Flask-restx. I can run the app using python app.py and the flask server runs on port 8888. I try to run the file using set FLASK_APP=app.py and...

Python Flask automatically generated Swagger/OpenAPI 3.0

Im trying to generate swagger document for my existing Flask app, I tried with Flask-RESTPlus initially and found out the project is abundant now and checked at the forked project flask-restx ...

Flask restx MarshallingError incorrect formatting

Problem context I'm experiencing some unexpected behaviour with MarshallingError, when generating api documentation using flask-restx. I have a custom flask-restx field definition, like...

Get list of lists from query parameters using flask_restx RequestParser

I am creating Python server using Flask and Flask-RESTX modules. I would like to define route e. g. for this URL: /users?sort=age,asc&sort=name,desc So when I read sort query parameter, I will...

flask-sqlalchemy read/write endpoints

I'm using flask/flask-sqlalchemy/flask-restx to build small micro-services; I'm using AWS Aurora with MySQL as database tech. Aurora conveniently provides separate read/write endpoints for the db...

Adding auth decorators to flask restx

I have a Flask application using flask-restx and flask-login. I would like all routes by default to require login, and explicitly define public routes that require no authentication. I have...

Flask restx model nested wildcard dict

I was wondering if I'm only one struggling with such problem. Lets take dict for example: data = {'totalSize': 3000, 'freq': 2400, 'distribution': {'ram1': {'size': 200,...

How to test the GET method that takes parser inputs in flask/flask-restx?

I am making a flask app using Flask-restx and I take inputs from the user by request parsing as follows: from flask_restx import Resource, reqparse from .services.calculator import...

Flask-Restx & Swagger Authorizations Sending Incorrect Token in Header

I have a Flask REST API that is using Flask-Restx, and JWT token authentication and is working making calls out of postman. However, when I am trying to use swagger, the token being sent is not...

Having Trouble Making a RESTful API with Flask-RestX: "No operations defined in spec!" and "404"s

In summary, I have been following the flask restx tutorials to make an api, however none of my endpoints appear on the swagger page ("No operations defined in spec!") and I just get 404 whenever I...

Python Flask_restplus flash_restx dynamic marshalling response

Is it possible to dynamicaly modify the marshalled response model (ie : change fields list, add mask, ...) ? ex : from flask_restplus import Resource, fields model = api.model('Model', { ...

How to model OneOf in Flask Restx?

I have the following schema doc { "$schema": "http://json-schema.org/draft-07/schema#", "title": "foo", "definitions": { "stuff": { "type": "object", ...

flask restx enum model

How to create an Enum api model in flask restx with one string field without other properties so that the following description is generated in swagger.yml? definitions: Colors: type:...

What's the best practice for working with numbers in DynamoDB (Python + boto3)

The Problem I know that DynamoDB is working with Decimals for every number it saves. I'm using python with boto3 and for every int I put in a table - it easily converts it to Decimal. The same...

Flask-Restx Api.model(strict=True) allowing unspecified params

I have a simple Users resource with a put method to update all user information except user password. According to Flask-Restx docs when a model has set the strict and validation params to true, a...

How to use data obtained from DB as values in add_argument() when the Flask app starts?

I have the following project structure for a Flask app using flask-restx . ├── app │   ├── extensions.py │   ├── __init__.py │   └── pv_dimensioning │   ...

How can I move my static folder to an url with a prefix with flask-restx

I am trying to deploy an app flask using flask-restx package and I am stuck on how to display properly the documentation on the prod server. It works well locally without any prefix, but on the...

How to generate OpenAPI v3 specification from Go source code?

Is there a way to generate OpenAPI v3 specification from go source code? Let's say I have a go API like the one below and I'd like to generate the OpenAPI specification (yaml file) from it....

Dropdown menu in Swagger with Flask (restx)

I am building my first API with the flask-restx lib. I use it to generate a Swagger documentation of my API with annotations. I currently have some fields for a post method but they all accept...

How to ignore certain scripts while testing flask app using pytest in gitlab CI/CD pipeline?

I have a flask-restx folder with the following structure . ├── app │   ├── extensions.py │   ├── __init__.py │   └── pv_dimensioning │   ├──...

Is it possible to use Flask RestX wih Flask's 2.0+ async await?

Usage of async/await was presented in Flask 2.0. (https://flask.palletsprojects.com/en/2.0.x/async-await/) I am using Flask-RestX so is it possible to use async/await in RestX requests...

How to use Marshmallow Schema in Flask-restx Swagger UI Automatically

I'm trying to create a restful web services with flask-restx and marshmallow. I'm using marshmallow for both request and response validations. Since flask-restx api docs does not support...