diff --git a/docs/proxyview.rst b/docs/proxyview.rst index 7bd9e6b..cb13d9e 100644 --- a/docs/proxyview.rst +++ b/docs/proxyview.rst @@ -15,11 +15,13 @@ This document covers the views provided by ``revproxy.views`` and all it's publi **Example urls.py**:: + from django.urls import re_path + from revproxy.views import ProxyView - urlpatterns = patterns('', - url(r'^(?P.*)$', ProxyView.as_view(upstream='http://example.com/')), - ) + urlpatterns = [ + re_path(r'(?P.*)', ProxyView.as_view(upstream='http://example.com/')), + ] **Attributes** @@ -109,6 +111,8 @@ This document covers the views provided by ``revproxy.views`` and all it's publi **Example urls.py**:: + from django.urls import re_path + from revproxy.views import DiazoProxyView proxy_view = DiazoProxyView.as_view( @@ -117,9 +121,9 @@ This document covers the views provided by ``revproxy.views`` and all it's publi diazo_theme_template='base.html', ) - urlpatterns = patterns('', - url(r'^(?P.*)$', proxy_view), - ) + urlpatterns = [ + re_path(r'(?P.*)', proxy_view), + ] **Example base.html** @@ -185,6 +189,7 @@ This document covers the views provided by ``revproxy.views`` and all it's publi See the example bellow:: + from django.urls import re_path from revproxy.views import DiazoProxyView @@ -199,9 +204,9 @@ This document covers the views provided by ``revproxy.views`` and all it's publi # urls.py - urlpatterns = patterns('', - url(r'^(?P.*)$', proxy_view), - ) + urlpatterns = [ + re_path(r'(?P.*)', proxy_view), + ] And than the data will be available in the template as follow: diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 5bcc877..51cf49e 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -45,22 +45,24 @@ Next, you'll need to create a View that extends ``revproxy.views.ProxyView`` and And now add your view in the ``urls.py``: .. code-block:: python + from django.urls import re_path from myapp.views import TestProxyView - urlpatterns = patterns('', - url(r'^(?P.*)$', TestProxyView.as_view()), - ) + urlpatterns = [ + re_path(r'(?P.*)', TestProxyView.as_view()), + ] Alternatively you could just use the default ProxyView as follow: .. code-block:: python + from django.urls import re_path from revproxy.views import ProxyView - urlpatterns = patterns('', - url(r'^(?P.*)$', ProxyView.as_view(upstream='http://example.com/')), - ) + urlpatterns = [ + re_path(r'(?P.*)', ProxyView.as_view(upstream='http://example.com/')), + ]