Here is views.py. I want to display all the links contained by 'www.pythonforbeginners.com' but the problem is it only displays the last link of the page. How can I solve it?

```
from django.shortcuts import render
from bs4 import BeautifulSoup
import urllib2

def home(request):
    url = urllib2.urlopen("http://www.pythonforbeginners.com")
    readurl = url.read()
    soup = BeautifulSoup(readurl)
    links = soup.find_all('a')
    for lin in links:
         result = lin.get('href')

    return render(request, 'search/homepage.html', {'result': result, 'url':url})

```

And here is homepage.html

```
{{ result }}

```

[And output I got:](https://i.stack.imgur.com/OAo7y.png)