简体   繁体   中英

Deploying WSGi app on AWS Lambda

I am trying to deploy WSGi based app that's built using Python, Flask on AWS Lambda.

But, it seems that the round trip of the request is going but when the request is being returned the werkzeug module is not able to call LambdaContext: Not a callable object.

'LambdaContext' object is not callable: TypeError Traceback (most recent call last): File "/home/ubuntu/venv/local/lib/python2.7/site-packages/flask/app.py", line 1997, in call File "/home/ubuntu/venv/local/lib/python2.7/site-packages/flask/app.py", line 1989, in wsgi_app File "/tmp/pip-install-Xytrxp/Werkzeug/werkzeug/wrappers.py", line 1277, in call TypeError: 'LambdaContext' object is not callable

I am trying to use serverless to deploy but my problem is that when i build a deployment package using serverless it's going to go beyond 250 MB which is the limit of AWS Lambda

I have built the package using Zappa by removing some of the unnecessary files in python packages and the size of that is 248 MB. I am able to use that to deploy but using serverless deploy is throwing issues.

So, is any one aware of what actually serverless does? Can we include serve.py and wsgi.py files in the AWS Lambda deployment package?

If yes, what are more changes needed to be able to just add these python files to deployment package to make the application wrapped on serverless.

I was able to handle this by using serverless-wsgi. We just need to include wsgi.py and .wsgi_app files and need to put wsgi.handler as the Lambda Function Handler

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM