Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mjumbewu/django-proxy
A simple HTTP proxy in a Django app
https://github.com/mjumbewu/django-proxy
Last synced: 10 days ago
JSON representation
A simple HTTP proxy in a Django app
- Host: GitHub
- URL: https://github.com/mjumbewu/django-proxy
- Owner: mjumbewu
- Created: 2013-03-06T21:23:07.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2023-01-09T06:08:03.000Z (almost 2 years ago)
- Last Synced: 2024-10-16T21:45:23.796Z (26 days ago)
- Language: Python
- Size: 21.5 KB
- Stars: 145
- Watchers: 6
- Forks: 38
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Django HTTP Proxy
=================
[![Tests Status](https://github.com/mjumbewu/django-proxy/actions/workflows/tests.yaml/badge.svg?branch=master&event=push)](https://github.com/mjumbewu/django-proxy/actions/workflows/tests.yaml)**Simple HTTP proxy service as a Django app.**
**Author:** Mjumbe Wawatu Ukweli, [Follow me on Twitter][1].
Installation
============Install with
```console
$ pip install django-proxy
```Overview
========Forward as close to an exact copy of the request as possible along to a
given url. Respond with as close to an exact copy of the resulting
response as possible.Includes a view function that can be used directly from a URL spec:
```python
from proxy.views import proxy_viewurlpatterns = patterns(
...
url('proxy/(?P.*)', proxy_view),
...
)
```Or from another view function:
```python
from django.views.decorators.csrf import csrf_exempt
from proxy.views import proxy_view@csrf_exempt
def myview(request, path):
extra_requests_args = {...}
remoteurl = 'http:///' + path
return proxy_view(request, remoteurl, extra_requests_args)urlpatterns = patterns(
...
url('proxy/(?P.*)', myview),
...
)
```Changelog
=========1.2.0
-----
* Bug Fix: Missing imports1.2.0
-----
* Convert relative URLs in `Location` headers to absolute.1.0.2
-----* Add `Content-length` to the set of headers not copies from the upstream
response.1.0.1
-----* Defer to the `requests` library for setting the Content-Length header
1.0.0
-----* Initial release, based on the HTTP proxy in OpenPlans'
https://github.com/openplans/shareabouts-django-clientLicense
=======Copyright © Mjumbe Wawatu Ukweli.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.[1]: http://twitter.com/mjumbewu