音乐/ urls.py
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^(?P<album_id>[0-9)+$', views.detail, name='detail'),
]
后跟views.py代码
from django.http import HttpResponse
def index(request):
return HttpResponse("<h1>this is something</h1>")
def detail(request, album_id):
return HttpResponse("<h2> details of album " + str(album_id)+"</h2>")
主网址网站构建正确..