Questions tagged [flask-restful]

Flask-RESTful provides an extension to Flask for building REST APIs. Flask-RESTful was initially developed as an internal project at Twilio, built to power their public and internal APIs.

Project repo is maintain on Github currently.
The latest document is here
Its pypi info can be find here

1619 questions
0
votes
2 answers

Receiving AssertionError using Flask sqlalchemy and restful

I have been stumped and can't seem to figure out why I am receiving an AssertionError. I am currently working on a rest api using the flask_restful lib. I am querying by: @staticmethod def find_by_id(id, user_id): f =…
m0bbin
  • 166
  • 2
  • 13
0
votes
1 answer

Flask-restful app fails when authentication is enabled

I'm getting this error whenever I try and enable authentication using flask_httpauth for my flask_restful project: AttributeError: 'function' object has no attribute 'as_view' Here's a very basic example: apicontroller.py: from flask_restful import…
Trondh
  • 3,221
  • 1
  • 25
  • 34
0
votes
1 answer

Accessing marshmallow decorators when using flask-marshmallow

I'm using flask-restful, flask-sqlalchemy and flask-marshmallow to build an API service. I define the following - ma = Marshmallow(app) However, trying to access the @validates decorator using ma throws an error. @ma.validates('field1') What am I…
0
votes
0 answers

Unwanted double quotes around server response in Python Flask-RESTful

I have an issue using python Flask-RESTful. Consider the code below: Class ServiceAPI(Resource): def post(self): return 'Hello, World!', 200 Then the client receives: "Hello, World!" instead of Hello, World! the extra double…
Ahmad Siavashi
  • 979
  • 1
  • 12
  • 29
0
votes
0 answers

Persistent Sessions on AWS Elastic Beanstalk with Flask

I have a Flask web application that is currently deployed on AWS Elastic Beanstalk with a configured Classic Load Balancer. My issue is that my sessions do not seem to be persistent, as I had originally implemented session based auth, but when the…
0
votes
2 answers

Best way to parse arguments in a REST api

I am building a Rest API based on flask Restful. And I'm troubled what would be the best way to parse the arguments I am waiting for. The info: Table Schema: ----------------------------------------- | ID | NAME | IP | MAIL | OS | PASSWORD…
Akis
  • 193
  • 10
0
votes
1 answer

Python flask Auto Redirect message

I have defined multplie service urls , all of which will execute same code. @service.route('/get_info/env=/starttime=/endtime=/entire=/over=/stage=', defaults={'name': None},…
alwaysAStudent
  • 2,110
  • 4
  • 24
  • 47
0
votes
1 answer

Sqlalchemy.exc.OperationalError: (psycopg2.OperationalError)

My Flask app (PostgreSQL database) is working fine in local. I pushed my code to server and there I tried to run.py db migrate, it throws these errors Traceback (most recent call last): File "run.py", line 11, in create_app().run() …
pd farhad
  • 6,352
  • 2
  • 28
  • 47
0
votes
0 answers

Flask app, jQuery sends a POST with JSON but Flask doesn't seem to understand the data sent by the webpage

I trying to create a sticky notes app. I'm stuck at a part where I try to send data in JSON format to Flask but when I print the POST request sent by the web page it it shows None Here is my code: Ajax Notes
Ketan
  • 115
  • 2
  • 10
0
votes
0 answers

How can I specify protocol in location header of my nginx response?

I have a Flask-Restful application running on nginx with uwsgi. Some of its endpoints are supposed to return an 202 Accepted response with Location: header. I didn't specify any protocol or hostname when I put the Location: header from my python…
0
votes
1 answer

How to handle a post request in Flask that contains a list

What i want is to handle an order placed to a server from an android app. To test things i am using POSTMAN. I tested it with the following code. class newOrder(Resource): ''' this class receives credentials from a post request and…
George Pamfilis
  • 1,397
  • 2
  • 19
  • 37
0
votes
4 answers

Prefered way of using Flask and S3 for large files

I know that this is a little bit open ended but I am confused as to what strategy/method to apply for a large file upload service developed using Flask and boto3. For smaller files and all it is fine. But it would be really nice to see what you guys…
SRC
  • 2,123
  • 3
  • 31
  • 44
0
votes
1 answer

Python blueprints does not scale to due not working with database connentions

I have sadly come into an issue with flask, blueprints, and restful with using a global db connection with mysql. How on earth does the blueprints resource get the global db conn? So if I define a global conn to python.connector then how can I use…
Tampa
  • 75,446
  • 119
  • 278
  • 425
0
votes
2 answers

How to access post data in flask using blueprints and restfull

How on earth do I get the post data from a flask app using blueprints and flask-restfull? why so hard? In my views.py file api.add_resource(register, '/api/driver/register') In my resource file: from flask_restful import fields, marshal_with,…
Tampa
  • 75,446
  • 119
  • 278
  • 425
0
votes
1 answer

Different model resource_fields for different blueprints

I have a Flask-RESTful based API, which currently has two blueprints, allowing me to version the API with backwards-incompatible changes. from api_1_0 import api_bp as api_1_0_blueprint app.register_blueprint(api_1_0_blueprint,…
Matt Healy
  • 18,033
  • 4
  • 56
  • 56