这个问题一般怎么解决呢
urls.py
urlpatterns = [
#主页
url(r'^$',views.index, name='index'),
# 音乐类别总占比饼状图
url(r'^$',views.music_category,name = 'music_category' ),
#每年歌曲发布数量折线图
url(r'^$',views.publishsongs,name = 'publishsongs' ),
#top10歌手平均分柱状图
url(r'^$',views.top10_singers,name = 'top10_singers' )
]
from django.shortcuts import render,HttpResponse
#跳转到主页
def index(request):
return render(request,'index.html')
跳转到音乐类别总占比饼状图
def music_category(request):
return render(request,'music_category.html')
#跳转到每年歌曲发布数量折线图
def publishsongs(request):
return render(request,'publishsongs.html')
#跳转到top10歌手平均分柱状图
def top10_singers(request):
return render(request,'top10_singers.html')