Django　ページネーションについて教えていただきたいです

Python Djangoという参考書で勉強していたのですが
４−３ページネーションの「ページの移動はどうするの？」で躓いてます。
firstはちゃんと動くのですが、prev,next,lastがどうしてもPage not foundになってしまいます。
何方か教えてくれませんか？
ソースはこんな感じです
初投稿なのでうまく使えてないと思います。すみません
django_app/hello/url.py
from django.urls import path
from . import views

urlpatterns=[
    path('',views.index,name='index'),
    path('<int:num>',views.index,name='index'),
    path('create',views.create,name='create'),
    path('edit/<int:num>',views.edit,name='edit'),
    path('delete/<int:num>',views.delete,name='delete'),
    path('find',views.find,name='find'),
    path('check',views.check,name='check'),
]

django_app/hello/views.py
from django.shortcuts import render
from django.http import HttpResponse
from django.shortcuts import redirect
from .models import Friend
from .forms import FriendForm
from .forms import FindForm
from django.db.models import Q
from django.db.models import Count,Sum,Avg,Min,Max
from .forms import CheckForm
from django.core.paginator import Paginator

def index(request,num=1):
    data = Friend.objects.all()
    page = Paginator(data,3)
    params = {
        'title': 'Hello',
        'message':'',
        'data': page.get_page(num),
    }
    return render(request,'hello/index.html',params)

#create model
def create(request):
    if (request.method == 'POST'):
        obj = Friend()
        friend = FriendForm(request.POST,instance=obj)
        friend.save()
        return redirect(to='/hello')
    params = {
        'title' : 'Hello',
        'form' : FriendForm(),
    }
    return render(request,'hello/create.html',params)
def edit(request,num):
    obj = Friend.objects.get(id=num)
    if (request.method == 'POST'):
        friend = FriendForm(request.POST,instance=obj)
        friend.save()
        return redirect(to='/hello')
    params={
        'title' : 'Hello',
        'id' : num,
        'form' : FriendForm(instance=obj),
    }
    return render(request,'hello/edit.html',params)
def delete(request,num):
    friend = Friend.objects.get(id=num)
    if (request.method == 'POST'):
        friend.delete()
        return redirect(to='/hello')
    params = {
        'title' : 'Hello',
        'id' : num,
        'obj' : friend,
    }
    return render(request,'hello/delete.html',params)

def find(request):
    if (request.method == 'POST'):
        msg = request.POST['find']
        form = FindForm(request.POST)
        sql = 'select * from hello_friend'
        if (msg != ''):
            sql += ' where ' + msg
        data = Friend.objects.raw(sql)
        msg = sql
    else:
        msg = 'search words...'
        form = FindForm()
        data =Friend.objects.all()
    params = {
        'title' : 'Hello',
        'message' : msg,
        'form' :form,
        'data' :data,
    }
    return render(request,'hello/find.html',params)
def check(request):
    params={
        'title' : 'Hello',
        'message' : 'check validation.',
        'form' : CheckForm(),
    }
    if (request.method == 'POST'):
        obj = Friend()
        form = FriendForm(request.POST,instance=obj)
        params['form'] = form
        if (form.is_valid()):
            params['message'] = 'OK!'
        else:
            params['message'] = 'no good.'
    return render(request,'hello/check.html',params)

django_app/hello/template/hello/index.html
{% load static %}
<!DOCTYPE html>
<html lang="ja">
<head>
    <meta charset="utf-8">
    <title>{{title}}</title>
    <link rel="stylesheet" type="text/css"
        href="{% static 'hello/css/style.css' %}" />
</head>
<body>
    <h1>{{title}}</h1>
    <p>{{message|safe}}</p>
    <table>
        <tr>
            <th>id</th>
            <th>name</th>
            <th>age</th>
            <th>mail</th>
            <th>birthday</th>
        </tr>
    {% for item in data %}
        <tr>
            <td>{{item.id}}</td>
            <td>{{item.name}}</td>
            <td>{{item.age}}</td>
            <td>{{item.mail}}</td>
            <td>{{item.birthday}}</td>
        </tr>
    {% endfor %}
    </table>
    <div class="pagination">
        {% if data.has_previous %}
            <a href="{% url 'index' %}">&laquo;first</a>
            <a href="{% url 'index' %}\
            {{data.previous_page_number}}">&laquo;prev</a>
        {% endif %}
        <span class="current">
            [{{data.number}}/{{data.paginator.num_pages}}]
        </span>
        {% if data.has_next %}
            <a href="{% url 'index' %}\
            {{data.next_page_number}}">next&raquo;</a>
            <a href="{% url 'index' %}\
            {{data.paginator.num_pages}}">last&raquo;</a>
        {% endif %}
    </div>
</body>
</html>