from django.shortcuts import render
from django.shortcuts import render, get_object_or_404
from .models import Album
# Create your views here.

def index(request):
    all_albums = Album.objects.all()
    context_data = {
        'all_albums': all_albums,
    }
    return render(request, 'music/index.html', context_data)

def detail(request, album_id):
    album = get_object_or_404(Album, pk=album_id)
    return render(request, "music/detail.html", {'album': album})

# Vid nr 22

3e1fcf69ce8094232bb64dc8c84868a831ae41ce
<mask token>

<mask token>


def detail(request, album_id):
    album = get_object_or_404(Album, pk=album_id)
    return render(request, 'music/detail.html', {'album': album})

<mask token>


def index(request):
    all_albums = Album.objects.all()
    context_data = {'all_albums': all_albums}
    return render(request, 'music/index.html', context_data)


def detail(request, album_id):
    album = get_object_or_404(Album, pk=album_id)
    return render(request, 'music/detail.html', {'album': album})

from django.shortcuts import render
from django.shortcuts import render, get_object_or_404
from .models import Album


def index(request):
    all_albums = Album.objects.all()
    context_data = {'all_albums': all_albums}
    return render(request, 'music/index.html', context_data)


def detail(request, album_id):
    album = get_object_or_404(Album, pk=album_id)
    return render(request, 'music/detail.html', {'album': album})

from django.shortcuts import render
from django.shortcuts import render, get_object_or_404
from .models import Album
# Create your views here.

def index(request):
    all_albums = Album.objects.all()
    context_data = {
        'all_albums': all_albums,
    }
    return render(request, 'music/index.html', context_data)

def detail(request, album_id):
    album = get_object_or_404(Album, pk=album_id)
    return render(request, "music/detail.html", {'album': album})

# Vid nr 22
