{"id":16889569,"url":"https://github.com/benoitc/dj-revproxy","last_synced_at":"2025-06-18T12:35:03.095Z","repository":{"id":1120396,"uuid":"992294","full_name":"benoitc/dj-revproxy","owner":"benoitc","description":"simple reverse proxy for django.","archived":false,"fork":false,"pushed_at":"2013-06-11T11:24:24.000Z","size":797,"stargazers_count":28,"open_issues_count":1,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-13T00:14:38.805Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/benoitc.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-10-16T10:53:46.000Z","updated_at":"2020-01-21T11:10:29.000Z","dependencies_parsed_at":"2022-08-16T12:05:19.714Z","dependency_job_id":null,"html_url":"https://github.com/benoitc/dj-revproxy","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/benoitc/dj-revproxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitc%2Fdj-revproxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitc%2Fdj-revproxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitc%2Fdj-revproxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitc%2Fdj-revproxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benoitc","download_url":"https://codeload.github.com/benoitc/dj-revproxy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitc%2Fdj-revproxy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260552337,"owners_count":23026810,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T16:57:45.257Z","updated_at":"2025-06-18T12:34:58.081Z","avatar_url":"https://github.com/benoitc.png","language":"Python","readme":"\n**Status: UNMAINTAINED**\n\nContact me if you want to take the lead.\n\n\n\n\ndj-revproxy\n-----------\n\nDjango reverse proxy. Allows you to proxy any website behind a prefix.\n\nRequirements\n------------\n\n- `Python \u003chttp://www.python.org\u003e`_ 2.x superior to 2.5 and Django\n- `Django \u003chttp://www.djangoproject.org\u003e`_  \u003e= 1.2\n- `restkit \u003chttp://benoitc.github.com/restkit\u003e`_ \u003e= 2.3.2\n\nInstallation\n------------\n\nInstall from sources::\n\n  $ python setup.py install\n\nOr from Pypi::\n\n  $ easy_install -U dj-revproxy \n\nConfiguration\n-------------\n\nAdd `revproxy`  to the list of applications::\n\n    INSTALLED_APPS = (\n        ...\n        'revproxy'\n    )\n\nUsage\n-----\n\nSince 0.2, there is 2 ways to use dj-revproxy.\n\n\n1. Generic view\n+++++++++++++++\n\nYou can use ``proxy_request`` function to proxy any url. You can use it in your code::\n\n    proxy_request(request, \"http://example.com\")\n\nThis code will proxy current request to ``http://example.com`` domain.\nThis function can take 5 parameters:\n\n- destination: string, the proxied url. Required\n- path: string, If no path is given it will try to detect the url using\n  the prefix if it's given. If not full request.path will be used in\n  finl destination url.\n- prefix: string, the prrefix behind we proxy the path\n  headers: dict, custom HTTP headers\n- no_redirect: boolean, False by default, do not redirect to \"/\" \n  if no path is given\n- decompress: boolean, False by default. If true the proxy will\n  decompress the source body if it's gzip encoded.\n\nIt return an instance of ``django.http.HttpResponse``. You can use it  directly\nin your urls.py (which is the eaiest way to use). Ex::\n\n    (r'^gunicorn(?P\u003cpath\u003e.*)', \"revproxy.proxy.proxy_request\", {\n        \"destination\": \"http://gunicorn.org\"\n    }),\n\n2. Configure multiple proxy behind one generic prefix\n+++++++++++++++++++++++++++++++++++++++++++++++++++++\n\nTo configure a proxy add a tupple to the REVPROXY_SETTINGS list::\n\n    REVPROXY_SETTINGS = [\n        (\"_google\", \"http://google.com\"),\n        (\"_friendpaste\", \"http://www.friendpaste.com\"),\n        (\"_couchdb\", \"http://127.0.0.1:5984\"),\n    ]\n\nThen configure your proxied urls automatically do something like this in\n``urls.py``:: \n    from django.conf.urls.defaults import *\n\n    import revproxy.proxy\n\n    urlpatterns = patterns('',\n        ...\n        (r'^proxy/', include(proxy.site_proxy.urls)),\n    )\n\nWhich will allow you to proxy Google on the url::\n\n    http://127.0.0.1:8000/proxy/_google\n\nor even::\n\n    ('^proxy/(?P\u003cprefix\u003e[^\\/]*)(.*)', \"proxy.site_proxy\"),\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenoitc%2Fdj-revproxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenoitc%2Fdj-revproxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenoitc%2Fdj-revproxy/lists"}