• Stars
    star
    136
  • Rank 267,670 (Top 6 %)
  • Language
    Python
  • Created almost 12 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A simple HTTP proxy in a Django app

Django HTTP Proxy

Tests Status

Simple HTTP proxy service as a Django app.

Author: Mjumbe Wawatu Ukweli, Follow me on Twitter.

Installation

Install with

$ 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:

from proxy.views import proxy_view

urlpatterns = patterns(
	...
	url('proxy/(?P<url>.*)', proxy_view),
	...
)

Or from another view function:

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://<host_name>/' + path
	return proxy_view(request, remoteurl, extra_requests_args)

urlpatterns = patterns(
	...
	url('proxy/(?P<path>.*)', myview),
	...
)

Changelog

1.2.0

  • Bug Fix: Missing imports

1.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

License

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.

More Repositories

1

django-rest-framework-csv

CSV Tools for Django REST Framework
Python
349
star
2

django-jstemplate

Embed Javascript templates (mustache.js and more) into Django templates with minimal fuss.
Python
40
star
3

django-model-blocks

Generic templates for Django models
Python
33
star
4

djangobars

An extension to allow Django to use Handlebars templates through the pybars port of Handlebars.js
Python
28
star
5

django-rest-framework-gis

GeoDjango tools for Django Rest Framework
Python
10
star
6

jokosher

Jokosher is a simple yet powerful multi-track studio. With it you can create and record music, podcasts and more, all from an integrated simple environment. Forked from https://launchpad.net/jokosher
Python
7
star
7

virtualenv-tools

Simple scripts for managing virtual environments
Shell
6
star
8

gof-patterns

A simple "flash cards" mobile app for the Gang of Four design patterns.
JavaScript
6
star
9

Septnuts

JavaScript
6
star
10

django-backbonejs

A module with a few convenience tags for integrating Backbone.js into a Django project
JavaScript
6
star
11

apps4septa

Python
5
star
12

elevator-pitch-builder

A recreation of the Harvard Business School Elevator Pitch Builder app
JavaScript
5
star
13

approval-workflows

An application to do approval workflows, and that's all. Very much in flux.
Python
4
star
14

phillytranspo_art

JavaScript
4
star
15

philly-councilmatic

Philly instance of Councilmatic
HTML
3
star
16

cyborgcity

3
star
17

LegisPy

Wrapper for Granicus's Legistar SOAP API
Python
3
star
18

django-model-filters

Django generic template filters for model instances and lists
Python
3
star
19

pcs-api

A screenscraping API for the PhillyCarShare reservation system
Python
2
star
20

My-Django-Template

A starter Django project, with a bunch of my default assumptions.
Python
2
star
21

subscribe.me

Subscribe to RSS and ATOM by email
Python
2
star
22

django-payable

An invoicing application built with Django and Stripe
Python
2
star
23

sample-local-councilmatic

A sample instance of Councilmatic, a subscription service for city council legislative information
XSLT
2
star
24

Task-Manager

A simple task manager, inspired by Pivotal Tracker
2
star
25

heroku-buildpack-python-no-node

Shell
2
star
26

Django-ORM-Standalone-Test

standalone-django-orm
Python
2
star
27

hamster-harvester

Utilities for syncing work between Harvest and Hamster time trackers
Python
2
star
28

odc-dotcloud

Open-Data-Catalog Dotcloud Deployment
Python
2
star
29

sharabouts-datastore-project

JavaScript
1
star
30

chicago-councilmatic

Python
1
star
31

gedit-settings

My gedit setup
Python
1
star
32

carshare-api

Simple carshare api. Meant to be much simpler than pcs-api
Python
1
star
33

pcs-mobile

A Python (AppEngine) front-end to the PCS reservation system API
Python
1
star
34

cbk-js-canvas

HTML
1
star
35

parcels-api

Python
1
star
36

electory

JavaScript
1
star
37

baldwin

Baldwin is a simple wrapper around the SEPTA "Next to Arrive" API to help you never miss your train.
JavaScript
1
star
38

musa-portfolio-template

SCSS
1
star
39

cyborg-city-presentation

HTML
1
star
40

shareabouts-dashboard

A simple dashboard for viewing Shareabouts stats
JavaScript
1
star
41

planning-feed-hub

JavaScript
1
star
42

tropo_colors

A simple application to change the background of a web page on voice command
Python
1
star
43

gnome-web-extensions

My extensions for the Web (Epiphany) Browser
JavaScript
1
star
44

BGC

A collection of documentation and resources for teaching young children to program
1
star
45

localplans

View public planning feeds on a map
JavaScript
1
star
46

Django-Notes

Just a wiki of examples for Django Generic Class-Based Views
1
star
47

try_git

1
star
48

django-subscriptions

Allow users to subscribe to feeds of information
Python
1
star