Giter VIP home page Giter VIP logo

Comments (5)

logandk avatar logandk commented on May 29, 2024

Indeed, and werkzeug should always be included in the deployment zip package, as per https://github.com/logandk/serverless-wsgi/blob/master/requirements.txt.

Are you getting this error after deploying to Lambda or when invoking sls wsgi serve?

from serverless-wsgi.

gmeans avatar gmeans commented on May 29, 2024

My use case might be an outlier. I was trying out serverless-python-requirements w/ the docker option because i have c-compiled extensions (psycopg2) that I want to deploy as well. I disabled this project's pack requirements option.

So since i didn't have werkzeug in my project requirements, it was never packaged.

from serverless-wsgi.

logandk avatar logandk commented on May 29, 2024

Ok, that makes sense. Compiled extensions is a problem with this plugin, one option would be to skip requirement packaging entirely and leave that to serverless-python-requirements which has a nice solution using Docker. I do like the idea of being able to include a single plugin for a simple flask app with no extensions, though. I will close this issue and continue to consider whether to drop requirement packaging, or at least provide some additional notes in the README. Thanks for reporting.

from serverless-wsgi.

brettdh avatar brettdh commented on May 29, 2024

I have the same case. I've disabled serverless-wsgi's requirements packaging and serverless-python-requirements is doing its job just fine (I checked the .requirements folder), but as above, I'm using Django, so I don't need werkzeug.

@logandk maybe I misread your response - I thought you were saying that it should work if I disable serverless-wsgi's requirements packaging? But it looks like wsgi.py imports werkzeug unconditionally.

I guess then the workaround is to install werkzeug even though I'm not using it directly?

from serverless-wsgi.

logandk avatar logandk commented on May 29, 2024

@brettdh Maybe that wasn't clear, you may disable the requirements packaging, but you will then need to add the werkzeug requirement yourself.

The WSGI wrapper that's included in this plugin relies on werkzeug for a number of things (handling headers, encodings etc.) - considering that werkzeug is a fairly lightweight dependency, I think it's the best option for serverless-wsgi rather than reimplementing those utilities inside the plugin. But I'm open to discussion on alternative approaches.

For now, I would recommend adding werkzeug for the single purpose of APIGW/WSGI mapping.

from serverless-wsgi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.