diff --git a/demo.py b/demo.py index 3d60137..75464b7 100644 --- a/demo.py +++ b/demo.py @@ -15,7 +15,7 @@ logging.basicConfig(level=logging.DEBUG) from django.conf import settings -from django.conf.urls import url +from django.urls import re_path from django.core.wsgi import get_wsgi_application from django.utils.timezone import now as tznow @@ -75,7 +75,7 @@ def get_context_data(self, **kwargs): urlpatterns = [ - url(r'^$', DemoPDFView.as_view()) + re_path(r'^$', DemoPDFView.as_view()) ] application = get_wsgi_application() diff --git a/docs/usage.rst b/docs/usage.rst index a659bae..fabec59 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -76,7 +76,7 @@ rendered from the HTML template. .. code-block:: python urlpatterns = [ - url(r'^hello.pdf$', HelloPDFView.as_view()) + path('hello.pdf', HelloPDFView.as_view()) ] You can also use a mixin to output PDF from Django generic views:: diff --git a/tests/urls.py b/tests/urls.py index 366854a..6d7ae9e 100644 --- a/tests/urls.py +++ b/tests/urls.py @@ -1,12 +1,12 @@ # coding=utf-8 -from django.conf.urls import url +from django.urls import re_path from easy_pdf.views import PDFTemplateView from .views import DemoPDFView, PDFUserDetailView urlpatterns = [ - url(r'^demo/$', DemoPDFView.as_view()), - url(r'^simple/$', PDFTemplateView.as_view(template_name='simple.html')), - url(r'^user/(?P\d+)/$', PDFUserDetailView.as_view()), + re_path(r'^demo/$', DemoPDFView.as_view()), + re_path(r'^simple/$', PDFTemplateView.as_view(template_name='simple.html')), + re_path(r'^user/(?P\d+)/$', PDFUserDetailView.as_view()), ]