diff options
Diffstat (limited to 'docs/intro/tutorial04.txt')
| -rw-r--r-- | docs/intro/tutorial04.txt | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/intro/tutorial04.txt b/docs/intro/tutorial04.txt index 7c544b7436..201cc7d928 100644 --- a/docs/intro/tutorial04.txt +++ b/docs/intro/tutorial04.txt @@ -71,7 +71,7 @@ create a real version. Add the following to ``polls/views.py``: from django.shortcuts import get_object_or_404, render from django.http import HttpResponseRedirect, HttpResponse - from django.core.urlresolvers import reverse + from django.urls import reverse from .models import Choice, Question # ... @@ -124,13 +124,13 @@ This code includes a few things we haven't covered yet in this tutorial: POST data. This tip isn't specific to Django; it's just good Web development practice. -* We are using the :func:`~django.core.urlresolvers.reverse` function in the +* We are using the :func:`~django.urls.reverse` function in the :class:`~django.http.HttpResponseRedirect` constructor in this example. This function helps avoid having to hardcode a URL in the view function. It is given the name of the view that we want to pass control to and the variable portion of the URL pattern that points to that view. In this case, using the URLconf we set up in :doc:`Tutorial 3 </intro/tutorial03>`, - this :func:`~django.core.urlresolvers.reverse` call will return a string like + this :func:`~django.urls.reverse` call will return a string like :: '/polls/3/results/' @@ -264,7 +264,7 @@ views and use Django's generic views instead. To do so, open the from django.shortcuts import get_object_or_404, render from django.http import HttpResponseRedirect - from django.core.urlresolvers import reverse + from django.urls import reverse from django.views import generic from .models import Choice, Question |
