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
1 answer

Regex in RequestParser for Python Flask-RESTful

Wondering if it's possible in Python Flask-RESTful, to use regular expressions while parsing arguments? For example, per the documentation for multiple values, I have the following argument I'm expecting in our API: parser.add_argument('fq',…
ghukill
  • 1,136
  • 17
  • 42
0
votes
1 answer

Equivalent of a requests Session object when unit testing a Flask RESTful API using a test_client

Building on a previous question of mine (How to unit test a Flask RESTful API), I'm trying to test a Flask RESTful API using a test_client without the app running, rather than using requests while the app is running. As a simple example, I have an…
Kurt Peek
  • 52,165
  • 91
  • 301
  • 526
0
votes
1 answer

display python script output in a web page [server running flask]

I'm running flask on an Azure server and send data from a form using POST, as an argument to a python script. Here's how I pass the argument to the script and run it os.system("python3 script.py " + postArgument) The output is displayed normally in…
Kalol Party
  • 81
  • 2
  • 3
  • 11
0
votes
1 answer

Flask POST route becoming unresponsive

I've just taken my first dip into Flask and am trying to use it to create an API which has GET, POST and DELETE routes to manage a blacklist of URLs. After a period of time the POST route gives me an error: "Could not get any response." The strange…
Finn LeSueur
  • 479
  • 5
  • 18
0
votes
1 answer

Flask restful model with variable keys

As a part of my RESTful API I found myself needing to return a json with "variable" keys, I'll try to make things more clear with a simple example: I have different groups, each group has a group_id, so the expected return would be: { 1: { …
Gal Pressman
  • 130
  • 1
  • 13
0
votes
1 answer

Upgrading Flask-RESTful and the settings object is gone. How to format dates now?

I need to update an application from Flask-RESTful 0.2.5 to 0.3.5. My API has over 40 endpoints, approximately 25 of which have entities that have datetime fields in them. When using 0.2.5, I followed the excellent provided in this Stack Overflow…
Ray Toal
  • 86,166
  • 18
  • 182
  • 232
0
votes
1 answer

Unable to return html content on REST API build with flask-restful

Absent
\r\n\t\t\tW - Withheld\r\n\t\t\t\r\n\t\t\tNote:
\r\n\t\t\tThis Sheet is for general idea of marks you secured. This is not for official use. If any mistakes appear; record at NEB ledger will be…
Tara Prasad Gurung
  • 3,422
  • 6
  • 38
  • 76
0
votes
1 answer

Crate AMI Performance Lower With Flask-RESTful Endpoint on EC2

Launched a Simple Crate AMI EC2 Instance and opened up the ports for Crate on 4200 and 5000 for Flask. When I run the EC2 instance with Crate AMI, the speeds are slower but still fast enough (~1-2 Second), but when I call the same with the Flask…
Augmented Jacob
  • 1,567
  • 19
  • 45
0
votes
1 answer

Error when using Flask_Restful in Openshift

I'm trying to create an openshift app using Flask restful. I was able to setup my app following the instructions in openshift website. But aside from that I want to use flask_restful. So I created a virtualenv and pip installed flask_restful. Then…
Lance
  • 2,774
  • 4
  • 37
  • 57
0
votes
1 answer

Flask-Restful Endpoint Throwing werkzeug.routing.BuildError

I am using Flask-Restful and SQLAlchemy to develop an API and am coming across a behaviour which I have a workaround for, but I am not sure the sticking with the workaround is a good long term strategy. Pretty standard API with a List item resource…
Andy G
  • 820
  • 1
  • 8
  • 11
0
votes
1 answer

How can I send data together with flask response object?

This is my code for sending data: @app.route('/testColoring') def testColoring(): ... return jsonify({'image_url': imgPath}) However, I would like to send it as a Response object, because I want to set the headers to disable cache.…
matchifang
  • 5,190
  • 12
  • 47
  • 76
0
votes
1 answer

Flask REST Blueprint not found

I am trying to split up my app that uses Flask, Blueprint and REST in different components. But I cannot get the api to work. The structure is as follows: restml |-> __init__.py |-> app.py \-> resources |-> __init__.py \-> hello.py My…
Stereo
  • 1,148
  • 13
  • 36
0
votes
1 answer

Running a flask service as a windows service

This must be really trivial, but i just cannot find a way to run a flask web service on a windows server (win server 2008). I can run it manually but how dot i get it to startup as a service so i can consume the service it code exposes. Here is a…
shivas
  • 913
  • 10
  • 15
0
votes
1 answer

Python Import Dependency

I know this question has been asked many times, but even after I tried many SO suggestions, I still cannot get it right. So, posting here for your help. I'm building a simple web server with Flask-Restful and Flask-SqlAlchemy. Basically, I think I'm…
gyoho
  • 799
  • 2
  • 9
  • 25
0
votes
1 answer

When using Flask with python 3 and SimpleITK 0.10.0 together, i am getting AttributeError: type object 'object' has no attribute '__getattr__'

When i run the code for Updating Tags in a DCM file using SimpleITK 0.10.0 in Python 3 (https://itk.org/SimpleITKDoxygen010/html/Python_2DicomModifyTags_8py-example.html) the code is working as explained. the moment i introduce flask components in…