Skip to main content

Django reverse proxy

Project description

dj-revproxy
-----------

Django reverse proxy. Allows you to proxy any website behind a prefix.

Requirements
------------

- `Python <http://www.python.org>`_ 2.x superior to 2.5 and Django
- `Django <http://www.djangoproject.org>`_ >= 1.2
- `restkit <http://www.couchdbkit.org>`_ >= 2.1.1

Installation
------------

Install from sources::

$ python setup.py install

Or from Pypi::

$ easy_install -U dj-revproxy

Configuration
-------------

Add `revproxy` to the list of applications::

INSTALLED_APPS = (
...
'revproxy'
)

To configure a proxy add a tupple to the REVPROXY_SETTINGS list::

REVPROXY_SETTINGS = [
("_google", "http://google.com"),
("_friendpaste", "http://www.friendpaste.com"),
("_couchdb", "http://127.0.0.1:5984"),
]

The configure your proxied urls automatically do something like this in
`urls.py`::
from django.conf.urls.defaults import *

import revproxy

urlpatterns = patterns('',
...
(r'^proxy/', include(revproxy.site_proxy.urls)),
)

Which will allow you to proxy Google on the url::

http://127.0.0.1:8000/proxy/_google

To add manually proxied urls and choose customs paths, do::


(r'^(?P<path>.*)', "revproxy.site_proxy", {"prefix":
"_friendpaste"}),

` <path>` will be the path passed to the proxied location. You can also
do something like::

('^_google(.*)', "revproxy.site_proxy", {"prefix": "_google"}),

or even::

('^(?P<prefix>[^\/]*)(.*)', "revproxy.site_proxy"),

which will allows you to proxy::

http://127.0.0.1:8000/proxy/_google

Or any proxy registered.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dj-revproxy-0.1.0.tar.gz (9.2 kB view details)

Uploaded Source

File details

Details for the file dj-revproxy-0.1.0.tar.gz.

File metadata

  • Download URL: dj-revproxy-0.1.0.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for dj-revproxy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7212d17352676cde72e55a9411d2d5d633a58fbeecb07c2797c9d19a99ddb822
MD5 eb302ae722a6ff01ff304f2a11620b35
BLAKE2b-256 2f14b56d83e59493da895a9335e82f8fbc681a523a4cf3a8666fc8695f70d9fc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page