#根目录的
urls.pyurlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^book/',include('book.urls',namespace='book')),]
#应用中的
urls.pyurlpatterns = [
url(r'^,views.index),
url(r'^a/(?P[0-9]+),views.a_page,name='a_page'),]
index.html中
<a href="/">返回首页方法</a>
<a href="{% url 'book:a_page' a.id %}">点击</a>