Comments (2)
I used a decorator I found on a blog post...
def wsgiwrap(func): def wsgi_app(environ, start_response): req = Request(environ) try: resp = func(req) except (exc.HTTPException, e): resp = e return resp(environ, start_response) return wsgi_app @wsgiwrap def simple_app(req): .... return Response(output) application = simple_app
This seems to work, but no idea if this is how it's intended to be used from the current documentation...
from webob.
The right answer for how to do this is https://docs.pylonsproject.org/projects/webob/en/stable/api/dec.html#webob.dec.wsgify. Open to any PRs to improve the docs but I think I'm going to mark this closed for now.
from webob.
Related Issues (20)
- schedule for next release? HOT 6
- Open file leak with file uploads with wsgi server in daemon mode HOT 6
- request.json_body generates unclosed file ResourceWarning HOT 1
- should `expires` be removed from set_cookie?
- Setting response.expires via timedelta produces an incorrect header value
- Moving from Python 2 -> 3 and hit snag with webob and JSON serializer, pickle works HOT 5
- 1.8.7: pytest warnings HOT 2
- Mapping urllib.error.HTTPError to webob HTTPError HOT 2
- 1.8.7 fails several tests with python3.9/3.10 with no attribute 'isAlive' HOT 1
- DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13 HOT 6
- Pull Request #438. Request.decode() errors argument ignored
- Misleading documentation of AcceptLanguageValidHeader.lookup HOT 1
- test_fieldstorage_not_multipart fails
- Adding PATCH method to environ_add_POST
- webob.request.disconnectionerror: the client disconnected while sending the body (22 more bytes were expected) HOT 2
- Is the maintenance plan updated for webob?
- Proposal: Clean up `MultiDict` inheritance from ABCs
- update or remove `__all__` declarations
- Encoding issue in request.py HOT 2
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 webob.