from django.shortcuts import render
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger

from .models import WangyiMusic

def show(request):
    song_menu = WangyiMusic.objects.order_by('-pnum')
    """
    paginator = Paginator(song_menu, 10)
    page = request.GET.get('page')
    try:
        menu = paginator.page(page)
    except PageNotAnInteger:
        menu = paginator.page(1)
    except EmptyPage:
        menu = paginator.page(paginator.num_pages)
    """
    return render(request, 'music/show.html',
            {
                'song_menu': song_menu,
            }
    )



fb8579be8d0f4172a32d1407d86bf8053cdbabf0
<mask token>

<mask token>


def show(request):
    song_menu = WangyiMusic.objects.order_by('-pnum')
    """
    paginator = Paginator(song_menu, 10)
    page = request.GET.get('page')
    try:
        menu = paginator.page(page)
    except PageNotAnInteger:
        menu = paginator.page(1)
    except EmptyPage:
        menu = paginator.page(paginator.num_pages)
    """
    return render(request, 'music/show.html', {'song_menu': song_menu})

from django.shortcuts import render
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from .models import WangyiMusic


def show(request):
    song_menu = WangyiMusic.objects.order_by('-pnum')
    """
    paginator = Paginator(song_menu, 10)
    page = request.GET.get('page')
    try:
        menu = paginator.page(page)
    except PageNotAnInteger:
        menu = paginator.page(1)
    except EmptyPage:
        menu = paginator.page(paginator.num_pages)
    """
    return render(request, 'music/show.html', {'song_menu': song_menu})

from django.shortcuts import render
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger

from .models import WangyiMusic

def show(request):
    song_menu = WangyiMusic.objects.order_by('-pnum')
    """
    paginator = Paginator(song_menu, 10)
    page = request.GET.get('page')
    try:
        menu = paginator.page(page)
    except PageNotAnInteger:
        menu = paginator.page(1)
    except EmptyPage:
        menu = paginator.page(paginator.num_pages)
    """
    return render(request, 'music/show.html',
            {
                'song_menu': song_menu,
            }
    )


