django-revproxy | Reverse Proxy view that supports all HTTP methods
kandi X-RAY | django-revproxy Summary
kandi X-RAY | django-revproxy Summary
Reverse Proxy view that supports all HTTP methods, Diazo transformations and Single Sign-On.
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of django-revproxy
django-revproxy Key Features
django-revproxy Examples and Code Snippets
Community Discussions
Trending Discussions on django-revproxy
QUESTION
I'm getting the error:
...ANSWER
Answered 2019-Oct-29 at 19:58JSONField
was added in Django 1.9 and you're using Django 1.8.2
QUESTION
I'm using django-revproxy and Django REST Framework in my project. And I'm exposing an API where users get analytics about their chatbots, and it works as the following:
- The user send requests the analytics from the Django project
- Django project, checks if the user is authenticated and owns that chatbot
if True
it contacts another external service.
My urls.py:
...ANSWER
Answered 2018-Oct-08 at 15:38You're having this error because django-revproxy
attempts to read the raw request body so it can create a proxy request to the upstream server.
However, with Django's (and WSGI's, and buffering) semantics, this isn't possible once you've accessed the request body as anything but a raw stream, which you do when you request.data.get('name')
. This parses the request body as JSON, HTTP multipart, whatever, depending on DRF's request negotiation configuration, and consumes the stream.
There are two ways you could get around this, as far as I see:
- pass
bot_name
somewhere else than the body; a query string parameter, an HTTP header, part of the URL, for instance, so you don't need to access the body, or - make the backend request yourself using
requests
instead of reverse-proxying (which is basically the same thing, but with added magic to try and copy the request through as-is).
QUESTION
I am using django-revproxy which proxies requests from my api to another api. How can i separate permissions for users? For example, i have url:
urls.py:
...ANSWER
Answered 2017-Jan-14 at 13:25I believe you can override view's dispatch()
method. Do the checks you need and if user is not allowed to perform given request — return response with code 403, otherwise continue normal flow.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install django-revproxy
No Installation instructions are available at this moment for django-revproxy.Refer to component home page for details.
Support
If you have any questions vist the community on GitHub, Stack Overflow.
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page