{"id":9684,"library":"django-revproxy","title":"Django RevProxy","description":"Django RevProxy (version 0.13.0) is a Django application that provides a robust reverse proxy solution. It allows you to seamlessly proxy external websites or services through your Django application, handling URL rewriting, cookie management, and header forwarding. The library sees active, though irregular, development, with a focus on stability and compatibility with modern Django versions.","status":"active","version":"0.13.0","language":"python","source_language":"en","source_url":"https://github.com/dpipro/django-revproxy","tags":["django","reverse-proxy","proxy","web-server","http","middleware"],"install":[{"cmd":"pip install django-revproxy","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"Core framework dependency for the application.","package":"Django","optional":false}],"imports":[{"wrong":"from revproxy import RevProxy","symbol":"default_app_config","correct":"from revproxy import default_app_config"}],"quickstart":{"code":"# myproject/settings.py\nimport os\n\nINSTALLED_APPS = [\n    'django.contrib.admin',\n    'django.contrib.auth',\n    'django.contrib.contenttypes',\n    'django.contrib.sessions',\n    'django.contrib.messages',\n    'django.contrib.staticfiles',\n    'revproxy',\n]\n\nSECRET_KEY = os.environ.get('DJANGO_SECRET_KEY', 'your-insecure-dev-secret-key')\nDEBUG = True\nALLOWED_HOSTS = []\n\nROOT_URLCONF = 'myproject.urls'\n\n# For simplicity in quickstart, typically more settings would be here\n\n# myproject/urls.py\nfrom django.contrib import admin\nfrom django.urls import path, re_path\nfrom revproxy.views import RevProxy\n\nurlpatterns = [\n    path('admin/', admin.site.urls),\n    # Proxy all requests under /external/ to example.com\n    # Access this at http://localhost:8000/external/\n    re_path(r'^external/(?P<path>.*)$', RevProxy.as_view(upstream='https://www.example.com/'))\n]","lang":"python","description":"This quickstart demonstrates how to add `django-revproxy` to your Django project. First, add 'revproxy' to your `INSTALLED_APPS`. Then, define a URL pattern in your `urls.py` that uses `RevProxy.as_view()` to point to an `upstream` URL. This example proxies all requests to `/external/` to `https://www.example.com/`. Remember to set a proper `SECRET_KEY` in production."},"warnings":[{"fix":"Always use `from django.urls import re_path` and `re_path(...)` for your regex-based proxy URL patterns.","message":"Older Django projects or examples from `django-revproxy` versions prior to 0.10.0 might use `django.conf.urls.url`. Django 2.0+ deprecated `url` in favor of `re_path` for regex-based URL patterns.","severity":"breaking","affected_versions":"< 0.10.0 (or Django < 2.0)"},{"fix":"For production, configure `REVPROXY_HISTORY_STORAGE_BACKEND` in `settings.py` to use a persistent storage like `django.contrib.sessions.backends.db` or a custom database-backed solution. Example: `REVPROXY_HISTORY_STORAGE_BACKEND = 'django.contrib.sessions.backends.db'`","message":"The default `REVPROXY_HISTORY_STORAGE_BACKEND` is in-memory (`revproxy.history.MemoryHistoryStorage`), which is not suitable for production environments with multiple processes or server restarts as it loses state.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Carefully validate and sanitize any user-provided `upstream` URLs. Explicitly whitelist allowed headers to forward using `REVPROXY_WHITELIST_TABLE_HEADERS` and control cookie forwarding to prevent unintended information disclosure or session conflicts.","message":"Proxying external services, especially with user-controlled `upstream` URLs or broad header forwarding, can introduce security vulnerabilities (e.g., SSRF, header injection, information leakage).","severity":"gotcha","affected_versions":"All versions"},{"fix":"If assets are not loading, try setting `REVPROXY_FORCE_REWRITE = True` in your `settings.py` to force `django-revproxy` to rewrite URLs in the proxied content. Ensure your `upstream` URL correctly points to the base of the external site.","message":"Static assets (CSS, JS, images) from the proxied site might not load correctly if they use relative URLs and the proxy path doesn't align with the original site structure, or if `django-revproxy` isn't configured to rewrite them.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'0.13.0':6 'activ':43 'allow':19 'applic':10,31 'compat':53 'cooki':35 'develop':46 'django':1,3,9,30,56,58 'extern':24 'focus':49 'forward':39 'handl':32 'header':38 'http':66 'irregular':45 'librari':41 'manag':36 'middlewar':67 'modern':55 'provid':12 'proxi':16,23,61,62 'revers':15,60 'reverse-proxi':59 'revproxi':2,4 'rewrit':34 'robust':14 'seamless':22 'see':42 'server':65 'servic':27 'solut':17 'stabil':51 'though':44 'url':33 'version':5,57 'web':64 'web-serv':63 'websit':25","created_at":"2026-04-17T01:20:10.628421+00:00","updated_at":"2026-04-17T01:20:10.628421+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.13.0","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/jazzband/django-revproxy","docs":"https://django-revproxy.readthedocs.io/en/stable/","changelog":"https://django-revproxy.readthedocs.io/en/latest/changelog.html","pypi":"https://pypi.org/project/django-revproxy/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework","http-networking"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-08-02","install_tag":null}}