Comments (5)
I did this instead and this worked!! just needed to wrap the response object
@app.route('/test.png') def get_test_png(): r = requests.get("https://www.google.com").content return Response( r.content, status=r.status_code, content_type=r.headers['content-type'], )
from zappa.
This may be a flask issue. By default I believe that flask attempts to return text/json as the response.
If you want to respond to your request with binary data, you need to prevent flask from attempting to convert the response content to text. I believe send_file can be used to return a binary response.
You can determine if this is a zappa issue by running flask locally and confirming that the error does not occur.
from zappa.
Error does not occur locally, only when deployed to lambdas and api gateway.
from zappa.
Can you provide the traceback with line numbers?
from zappa.
Closing this as it appears to be resolved by adjusting the response in the flask app.
from zappa.
Related Issues (20)
- django.server logs are not shown in CloudWatch - Using Zappa HOT 3
- Enpoint request timedout error (Django deployed with zappa) HOT 2
- API Gateway Resource Policy limits with too many scheduled events HOT 2
- zappa certify → AttributeError: 'NoneType' object has no attribute 'split' HOT 6
- Please create 'version' command that prints zappa version HOT 3
- There's no obvious way to join the Zappa slack HOT 5
- Add direct support for Amazon secrets manager HOT 5
- Tiktoken package for openai script not working HOT 3
- Python 3.12 not supported
- Python 3.12 is not supported HOT 1
- Python3.12 is not supported HOT 1
- Provide better error message for the user's failure to run `pip freeze
- Incorrect CLI Error Messaging
- Zappa tries to create new S3 bucket when it can't access the already existing one
- SQS event creating when it should be updating
- Implement OICD authentication for PyPi package publishing
- zappa task is not working asyncronous on recurlsive call HOT 1
- Set cloudwatch retention period
- Python 3.10 not supported in latest package version HOT 3
- S3 bucket is not reused with `slim_handler: True`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zappa.