summaryrefslogtreecommitdiff
path: root/docs/intro/tutorial03.txt
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-02-22 09:59:56 -0500
committerTim Graham <timograham@gmail.com>2015-02-22 14:20:02 -0500
commitb2f331dc68ec3c5a34285f7af9614e4178e9a371 (patch)
tree8e9f7fa2b644634bf6a6b375c739d513e7c7c3d7 /docs/intro/tutorial03.txt
parentff5e47e7a4a638a30424331222e0abdb60842ddd (diff)
Updated tutorial to use explicit relative imports.
Diffstat (limited to 'docs/intro/tutorial03.txt')
-rw-r--r--docs/intro/tutorial03.txt14
1 files changed, 7 insertions, 7 deletions
diff --git a/docs/intro/tutorial03.txt b/docs/intro/tutorial03.txt
index 83ed0cff70..cf0d4dedf5 100644
--- a/docs/intro/tutorial03.txt
+++ b/docs/intro/tutorial03.txt
@@ -94,7 +94,7 @@ In the ``polls/urls.py`` file include the following code:
from django.conf.urls import url
- from polls import views
+ from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
@@ -209,7 +209,7 @@ Wire these new views into the ``polls.urls`` module by adding the following
from django.conf.urls import url
- from polls import views
+ from . import views
urlpatterns = [
# ex: /polls/
@@ -296,7 +296,7 @@ commas, according to publication date:
from django.http import HttpResponse
- from polls.models import Question
+ from .models import Question
def index(request):
@@ -374,7 +374,7 @@ Now let's update our ``index`` view in ``polls/views.py`` to use the template:
from django.http import HttpResponse
from django.template import RequestContext, loader
- from polls.models import Question
+ from .models import Question
def index(request):
@@ -406,7 +406,7 @@ rewritten:
from django.shortcuts import render
- from polls.models import Question
+ from .models import Question
def index(request):
@@ -436,7 +436,7 @@ for a given poll. Here's the view:
from django.http import Http404
from django.shortcuts import render
- from polls.models import Question
+ from .models import Question
# ...
def detail(request, question_id):
try:
@@ -471,7 +471,7 @@ provides a shortcut. Here's the ``detail()`` view, rewritten:
from django.shortcuts import get_object_or_404, render
- from polls.models import Question
+ from .models import Question
# ...
def detail(request, question_id):
question = get_object_or_404(Question, pk=question_id)