Questions tagged [falconframework]

A bare-metal Python web API framework for building very fast app backends and microservices.

Unlike other Python web frameworks, Falcon won't bottleneck your API's performance under highly concurrent workloads. Many frameworks max out at serving simple "hello world" requests at a few thousand req/sec, while Falcon can easily serve many more on the same hardware.

Falcon isn't very opinionated. In other words, the framework leaves a lot of decisions and implementation details to you, the API developer, which means you will need to use your head a little more than other web frameworks, and probably write a little more code. On the other hand, this gives you a lot of freedom to customize and tune your implementation in order to create a solution that stands out from the crowd.

Falcon doesn't include a lot of cruft that is simply unnecessary when building web services. Less code and fewer dependencies means a smaller attack surface, lower memory usage, and fewer places for bugs to hide. Our build fails at anything less than 100% code coverage, and we use Travis and Coveralls to keep ourselves honest.

https://falconframework.org/

199 questions
43
votes
2 answers

How to secure own backend API which serves only my frontend?

I'm setting up a webapp with a frontend and a backend that communicates with the frontend soley through RESTful methods. How do I make sure that the backend endpoints are only accessed by my own frontend, and not anyone else? I cannot find much…
Donald
  • 693
  • 1
  • 7
  • 12
16
votes
8 answers

Python Falcon - get POST data

I try to use falcon package in my project. Problem is I didn't find a way to get body data from the HTTP post request. I used code from example, but req.stream.read() doesn't return JSON as expected. The code is: raw_json =…
Gomi
  • 632
  • 1
  • 7
  • 23
14
votes
2 answers

SQLAlchemy and Falcon - session initialization

I'm wondering where the best place would be to create a scoped session for use in falcon. From reading the flask-sqlalchemy code, it, in a round about way, does something like this: from sqlalchemy import create_engine from sqlalchemy.orm import…
synic
  • 26,359
  • 20
  • 111
  • 149
13
votes
4 answers

Python falcon and async operations

I am writing an API using python3 + falcon combination. There are lot of places in methods where I can send a reply to a client but because of some heavy code which does DB, i/o operations, etc it has to wait until the heavy part ends. For…
Glueon
  • 3,727
  • 4
  • 23
  • 32
10
votes
1 answer

Python web service subscribed to reactive source produces strange behavior in object

I have implemented a web service using Falcon. This service stores a state machine (pytransitions) that is passed to service's resources in the constructor. The service is runs with gunicorn. The web service launches a process on start using RxPy.…
Jav_Rock
  • 22,059
  • 20
  • 123
  • 164
10
votes
1 answer

Celery: No Result Backend Configured?

I am trying to check celery results from the command line but get a No Result Backend Configured error. I have setup redis as my result backend and am now at a loss. I have the celery app setup like…
jramm
  • 6,415
  • 4
  • 34
  • 73
10
votes
3 answers

How to serve a static webpage from falcon application?

I am new to python and hence falcon. I started developing a RESTful API and falcon so far is great for it. There is some other requirement to serve a static web page and I dont want to write an app or spawn a server for that. Is it possible from…
wayfare
  • 1,802
  • 5
  • 20
  • 37
9
votes
3 answers

How to use query string in Falcon python

Ho do you configure the app to have following features: Have an api-endpoint defined as app.add_route('/v1/tablets', TabletsCollection()) And still be able to use QueryParams like this https://example.com/api/v1/tablets?limit=12&offset=50&q=tablet…
woss
  • 933
  • 1
  • 11
  • 20
8
votes
2 answers

Python OAuth2 server with social networks for a RESTfull API

I'm trying to implement OAuth2 server for a RESTfull API with a login option through social platforms (Github, Facebook, Instagram) using Python and Falcon web framework. But I've struggled to understand how this thing should work. My current…
Vit D
  • 193
  • 1
  • 7
  • 25
8
votes
4 answers

How to upload files using React?

so currently I am trying to upload a file, and save it on the Google Clouds. But I am stuck at how to get the input file using React-Redux. Basically, my back-end part already finish, I tested it using HTTPie with this command HTTP…
user8152941
8
votes
3 answers

How to respond with HTTP 500 on any unhandled exception in Falcon framework

Is there a way in Falcon framework to respond with HTTP 500 status on any unspecific exception that is not handled in resource handler? I've tried to add following handler for Exception: api.add_error_handler(Exception, …
Anton Patiev
  • 83
  • 1
  • 5
7
votes
1 answer

Selenium + Flask/Falcon in Python - 502 Bad Gateway Error

I'm using selenium to make a headless scraping of a website within an endpoint of an API using Flask for Python. I made several tests and my selenium scraping code works perfectly within a script and while running as an API in the localhost.…
Thiago
  • 694
  • 3
  • 12
  • 26
7
votes
2 answers

How can we get path params in falcon middleware, if any path param in the route?

My routes are as follows: app.add_route('/v1/my_route', MyResource()) app.add_route('/v1/my_route/{app_id}', MyResource()) app.add_route('/v1/my_route2/any_route', AnyRouteResource()) app.add_route('/v1/my_route2/any_route/{app_id}',…
Nilesh Soni
  • 405
  • 5
  • 12
7
votes
1 answer

Environment set up for running a falcon app

I've a simple falcon app which I'm running on the terminal using the following command, gunicorn -b 0.0.0.0:5000 main:app --reload main.py is the python file which instantiates app = falcon.API(). This works. So I tried to set this config inside of…
Melissa Stewart
  • 3,483
  • 11
  • 49
  • 88
7
votes
0 answers

Falcon - how to validate incoming requests against Swagger specification?

What is the most convenient and comprehensive way of validating incoming requests in Falcon views against Swagger 2.0 specification written in json? I used to do the same for Pyramid apps with great tool called pyramid_swagger. It was seamlessly…
gwaramadze
  • 4,523
  • 5
  • 30
  • 42
1
2 3
13 14